diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-25 05:55:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-25 05:55:40 +0000 |
commit | 8b6af8a2a9a36bc9324c60d80cea021abf4d42d8 (patch) | |
tree | e46740dba6f1b23db1b61f8326d0c2b6c37e1b25 /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 2df9f8df9541e7650876413cde555eb3d285be4b (diff) |
LSR wants to split the landing pad's critical edge. Let it do it, but use the
proper function to do it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138550 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 2d93cac11c..3938ab6955 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -3625,7 +3625,14 @@ void LSRInstance::RewriteForPHI(PHINode *PN, Loop *PNLoop = LI.getLoopFor(Parent); if (!PNLoop || Parent != PNLoop->getHeader()) { // Split the critical edge. - BasicBlock *NewBB = SplitCriticalEdge(BB, Parent, P); + BasicBlock *NewBB = 0; + if (!Parent->isLandingPad()) { + NewBB = SplitCriticalEdge(BB, Parent, P); + } else { + SmallVector<BasicBlock*, 2> NewBBs; + SplitLandingPadPredecessors(Parent, BB, "", "", P, NewBBs); + NewBB = NewBBs[0]; + } // 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 |