summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-25 05:55:40 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-25 05:55:40 +0000
commit3fb137f7ef6ae13368913c9fdda4bfd9912d47b9 (patch)
treea3e112e0ccb3bc1a8ca24b2b522a8876931cbf47 /llvm/lib/Transforms
parent447ff1bfdc853f11ff2e13349a8f308609fae5a5 (diff)
downloadbcm5719-llvm-3fb137f7ef6ae13368913c9fdda4bfd9912d47b9.tar.gz
bcm5719-llvm-3fb137f7ef6ae13368913c9fdda4bfd9912d47b9.zip
LSR wants to split the landing pad's critical edge. Let it do it, but use the
proper function to do it. llvm-svn: 138550
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 2d93cac11cc..3938ab6955e 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud