[SROA] Refactor the integer and vector promotion testing logic to
authorChandler Carruth <chandlerc@gmail.com>
Wed, 24 Dec 2014 01:05:14 +0000 (01:05 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 24 Dec 2014 01:05:14 +0000 (01:05 +0000)
commitc807870534f0ad10051fd6c6be515d7122d1a00c
tree9a399ce0fa62141c99fb5c2a9c4f2dec3fe820c6
parent3545994ffe768164c6f66cb8c132faff2896e258
[SROA] Refactor the integer and vector promotion testing logic to
operate in terms of the new Partition class, and generally have a more
clear set of arguments. No functionality changed.

The most notable improvements here are consistently using the
terminology of 'partition' for a collection of slices that will be
rewritten together and 'slice' for a region of an alloca that is used by
a particular instruction.

This also makes it more clear that the split things are actually slices
as well, just ones that will be split by the proposed partition.

This doesn't yet address the confusing aspects of the partition's
interface where slices that will be split by the partition and start
prior to the partition are accesssed via Partition::splitSlices() while
the core range of slices exposed by a Partition includes both unsplit
slices and slices which will be split by the end, but started within the
offset range of the partition. This is particularly hard to address
because the algorithm which computes partitions quite literally doesn't
know which slices these will end up being until too late. I'm looking at
whether I can fix that or not, but I'm not optimistic. I'll update the
comments and/or names to further explain this either way. I've also
added one FIXME in this patch relating to this confusion so that I don't
forget about it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224798 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SROA.cpp