summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-01-28 23:06:47 +0000
committerPhilip Reames <listmail@philipreames.com>2015-01-28 23:06:47 +0000
commit9198b33b48967bd9d692cd56f831acfe08e7197f (patch)
tree2be840d4118b911c2db777d2812d7d0c49bcb605 /llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
parenta8fbcf0c1f9f3cff3a3deafe4bbb70419a822185 (diff)
downloadbcm5719-llvm-9198b33b48967bd9d692cd56f831acfe08e7197f.tar.gz
bcm5719-llvm-9198b33b48967bd9d692cd56f831acfe08e7197f.zip
Teach SplitBlockPredecessors how to handle landingpad blocks.
Patch by: Igor Laevsky <igor@azulsystems.com> "Currently SplitBlockPredecessors generates incorrect code in case if basic block we are going to split has a landingpad. Also seems like it is fairly common case among it's users to conditionally call either SplitBlockPredecessors or SplitLandingPadPredecessors. Because of this I think it is reasonable to add this condition directly into SplitBlockPredecessors." Differential Revision: http://reviews.llvm.org/D7157 llvm-svn: 227390
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index d4d61f2dba7..520b9059917 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -119,15 +119,8 @@ static void ConnectProlog(Loop *L, Value *TripCount, unsigned Count,
assert(Exit && "Loop must have a single exit block only");
// Split the exit to maintain loop canonicalization guarantees
SmallVector<BasicBlock*, 4> Preds(pred_begin(Exit), pred_end(Exit));
- if (!Exit->isLandingPad()) {
- SplitBlockPredecessors(Exit, Preds, ".unr-lcssa", AA, DT, LI,
- P->mustPreserveAnalysisID(LCSSAID));
- } else {
- SmallVector<BasicBlock*, 2> NewBBs;
- SplitLandingPadPredecessors(Exit, Preds, ".unr1-lcssa", ".unr2-lcssa",
- NewBBs, AA, DT, LI,
- P->mustPreserveAnalysisID(LCSSAID));
- }
+ SplitBlockPredecessors(Exit, Preds, ".unr-lcssa", AA, DT, LI,
+ P->mustPreserveAnalysisID(LCSSAID));
// Add the branch to the exit block (around the unrolled loop)
BranchInst::Create(Exit, NewPH, BrLoopExit, InsertPt);
InsertPt->eraseFromParent();
OpenPOWER on IntegriCloud