summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorKevin Qin <Kevin.Qin@arm.com>2015-03-09 07:26:37 +0000
committerKevin Qin <Kevin.Qin@arm.com>2015-03-09 07:26:37 +0000
commit65b07b8e1b73816dc7f339e2c461f1bc72443319 (patch)
tree52516b5c4d3034b36921e6d7d2e47e1b6aea36d5 /llvm/lib/Transforms
parentf8f259df48d3af96b06b50b14cc08e7e72b028ce (diff)
downloadbcm5719-llvm-65b07b8e1b73816dc7f339e2c461f1bc72443319.tar.gz
bcm5719-llvm-65b07b8e1b73816dc7f339e2c461f1bc72443319.zip
Revert r231630 - Run LICM pass after loop unrolling pass.
As it broke llvm bootstrap. llvm-svn: 231635
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp8
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp9
2 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 7ff55a7c7e1..21fa34dfbcf 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -364,14 +364,8 @@ void PassManagerBuilder::populateModulePassManager(
MPM.add(createCFGSimplificationPass());
MPM.add(createInstructionCombiningPass());
- if (!DisableUnrollLoops) {
+ if (!DisableUnrollLoops)
MPM.add(createLoopUnrollPass()); // Unroll small loops
- // Runtime unrollng will introduce runtime check in loop prologue. If the
- // unrolled loop is a inner loop, then the prologue will be inside the
- // outer loop. LICM pass can help to promote the runtime check out if the
- // checked value is loop invariant.
- MPM.add(createLICMPass());
- }
// After vectorization and unrolling, assume intrinsics may tell us more
// about pointer alignments.
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 9e2d8c98b9e..91b688cc8e1 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -142,7 +142,7 @@ static void CloneLoopBlocks(Loop *L, Value *NewIter, const bool UnrollProlog,
BasicBlock *InsertTop, BasicBlock *InsertBot,
std::vector<BasicBlock *> &NewBlocks,
LoopBlocksDFS &LoopBlocks, ValueToValueMapTy &VMap,
- LoopInfo *LI, LPPassManager *LPM) {
+ LoopInfo *LI) {
BasicBlock *Preheader = L->getLoopPreheader();
BasicBlock *Header = L->getHeader();
BasicBlock *Latch = L->getLoopLatch();
@@ -153,7 +153,10 @@ static void CloneLoopBlocks(Loop *L, Value *NewIter, const bool UnrollProlog,
Loop *ParentLoop = L->getParentLoop();
if (!UnrollProlog) {
NewLoop = new Loop();
- LPM->insertLoop(NewLoop, ParentLoop);
+ if (ParentLoop)
+ ParentLoop->addChildLoop(NewLoop);
+ else
+ LI->addTopLevelLoop(NewLoop);
}
// For each block in the original loop, create a new copy,
@@ -387,7 +390,7 @@ bool llvm::UnrollRuntimeLoopProlog(Loop *L, unsigned Count, LoopInfo *LI,
// the loop, otherwise we create a cloned loop to execute the extra
// iterations. This function adds the appropriate CFG connections.
CloneLoopBlocks(L, ModVal, UnrollPrologue, PH, PEnd, NewBlocks, LoopBlocks,
- VMap, LI, LPM);
+ VMap, LI);
// Insert the cloned blocks into function just before the original loop
F->getBasicBlockList().splice(PEnd, F->getBasicBlockList(), NewBlocks[0],
OpenPOWER on IntegriCloud