summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorKevin Qin <Kevin.Qin@arm.com>2015-03-09 06:14:07 +0000
committerKevin Qin <Kevin.Qin@arm.com>2015-03-09 06:14:07 +0000
commita998735def5f04459fa6cbeaaffbb42f1a1dec5c (patch)
tree82a5ff86e24b5e27caffbb29b94df869abb4974a /llvm/lib/Transforms/IPO
parent7b68b90c159924f76d25fadf43ff72469b7ba573 (diff)
downloadbcm5719-llvm-a998735def5f04459fa6cbeaaffbb42f1a1dec5c.tar.gz
bcm5719-llvm-a998735def5f04459fa6cbeaaffbb42f1a1dec5c.zip
Run LICM pass after loop unrolling pass.
Runtime unrollng will introduce a runtime check in loop prologue. If the unrolled loop is a inner loop, then the proglogue will be inside the outer loop. LICM pass can help to promote the runtime check out if the checked value is loop invariant. llvm-svn: 231630
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 21fa34dfbcf..7ff55a7c7e1 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -364,8 +364,14 @@ 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.
OpenPOWER on IntegriCloud