OSDN Git Service

[SROA] Lift the logic for traversing the alloca slices one partition at
authorChandler Carruth <chandlerc@gmail.com>
Mon, 22 Dec 2014 22:46:00 +0000 (22:46 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 22 Dec 2014 22:46:00 +0000 (22:46 +0000)
commit67924e9af8de5e04fe21e11576646ea95ca76aef
tree2126214f0ceb8f3b999db0ab2aaf420147e0492a
parenta559a2317c908b5cd8336360cffdde2d2a977006
[SROA] Lift the logic for traversing the alloca slices one partition at
a time into a partition iterator and a Partition class.

There is a lot of knock-on simplification that this enables, largely
stemming from having a Partition object to refer to in lots of helpers.
I've only done a minimal amount of that because enoguh stuff is changing
as-is in this commit.

This shouldn't change any observable behavior. I've worked hard to
preserve the *exact* traversal semantics which were originally present
even though some of them make no sense. I'll be changing some of this in
subsequent commits now that the logic is carefully factored into
a reusable place.

The primary motivation for this change is to break the rewriting into
phases in order to support more intelligent rewriting. For example, I'm
planning to change how split loads and stores are rewritten to remove
the significant overuse of integer bit packing in the resulting code and
allow more effective secondary splitting of aggregates. For any of this
to work, they have to share the exact traversal logic.

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