]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
Finish fixing the SSAUpdater-based AllocaPromoter strategy in SROA to cope with
authorChandler Carruth <chandlerc@gmail.com>
Sun, 11 Aug 2013 01:56:15 +0000 (01:56 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 11 Aug 2013 01:56:15 +0000 (01:56 +0000)
commit37508bb842d9beedd75139a589c6f538f90efbaa
tree25c35edb349450ac51902815bbfb245503d629e2
parent3c7a446059133de68c912242cb3b0cc934b8e6b1
Finish fixing the SSAUpdater-based AllocaPromoter strategy in SROA to cope with
the more general set of patterns that are now handled by mem2reg and that we
can detect quickly while doing SROA's initial analysis. Notably, this allows it
to promote through no-op bitcast and GEP sequences. A core part of the
SSAUpdater approach is the ability to test whether a particular instruction is
part of the set being promoted. Testing this becomes significantly more complex
in the world where the operand to every load and store isn't the alloca itself.
I ended up using the approach of walking up the def-chain until we find the
alloca. I benchmarked this against keeping a set of pointer operands and
keeping a set of the loads and stores we care about, and this one seemed faster
although the difference was very small.

No test case yet because currently the rewriting always "fixes" the inputs to
not require this. The next patch which re-enables early promotion of easy cases
in SROA will include a test case that specifically exercises this aspect of the
alloca promoter.

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