diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-25 01:08:34 +0000 |
commit | 89d4411cef736898047aa7e3bc159da39cacf8e6 (patch) | |
tree | 0cff549e497ac6e7ed3beed48680279ccccb29b7 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | b8cfe4ff411d92b150ce7ec6ec3568ad187dd517 (diff) |
When inserting new instructions, use getFirstInsertionPt instead of
getFirstNonPHI so that it will skip over the landingpad instructions as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index ac4e741a6e..2d93cac11c 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -3621,10 +3621,11 @@ void LSRInstance::RewriteForPHI(PHINode *PN, // users. if (e != 1 && BB->getTerminator()->getNumSuccessors() > 1 && !isa<IndirectBrInst>(BB->getTerminator())) { - Loop *PNLoop = LI.getLoopFor(PN->getParent()); - if (!PNLoop || PN->getParent() != PNLoop->getHeader()) { + BasicBlock *Parent = PN->getParent(); + Loop *PNLoop = LI.getLoopFor(Parent); + if (!PNLoop || Parent != PNLoop->getHeader()) { // Split the critical edge. - BasicBlock *NewBB = SplitCriticalEdge(BB, PN->getParent(), P); + BasicBlock *NewBB = SplitCriticalEdge(BB, Parent, P); // If PN is outside of the loop and BB is in the loop, we want to // move the block to be immediately before the PHI block, not |