summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2015-09-24 03:50:17 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2015-09-24 03:50:17 +0000
commit74621cced742f10c4ba733793757a73d1bd60fa7 (patch)
tree16b1eb657f542a4158663da92cc4065e2c7ebd08 /llvm/lib/Transforms
parent0c8decd108de8e788b8214f9f5a542236b78b9c5 (diff)
downloadbcm5719-llvm-74621cced742f10c4ba733793757a73d1bd60fa7.tar.gz
bcm5719-llvm-74621cced742f10c4ba733793757a73d1bd60fa7.zip
Add CFG Simplification pass after Loop Unswitching.
Loop unswitching produces conditional branches with constant condition, and it's beneficial for later passes to clean this up with simplify-cfg. We do this after the second invocation of loop-unswitch, but not after the first one. Not doing so might cause problem for passes like LoopUnroll, whose estimate of loop body size would be less accurate. Reviewers: hfinkel Differential Revision: http://reviews.llvm.org/D13064 llvm-svn: 248460
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index fcb62db06e9..77c2de035f7 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -260,6 +260,7 @@ void PassManagerBuilder::populateModulePassManager(
MPM.add(createLoopRotatePass(SizeLevel == 2 ? 0 : -1));
MPM.add(createLICMPass()); // Hoist loop invariants
MPM.add(createLoopUnswitchPass(SizeLevel || OptLevel < 3));
+ MPM.add(createCFGSimplificationPass());
MPM.add(createInstructionCombiningPass());
MPM.add(createIndVarSimplifyPass()); // Canonicalize indvars
MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
OpenPOWER on IntegriCloud