summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Passes
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-11-15 16:33:11 +0000
committerSanjay Patel <spatel@rotateright.com>2017-11-15 16:33:11 +0000
commit3e29890a7f5b4a9efaecb5884fb29ee87c8571fb (patch)
tree9d4a3e2d9e8eeaab7abf4f79111f01560f0a0e2f /llvm/lib/Passes
parentd1becd082a233d6aab18d774b33a422b016bf559 (diff)
downloadbcm5719-llvm-3e29890a7f5b4a9efaecb5884fb29ee87c8571fb.tar.gz
bcm5719-llvm-3e29890a7f5b4a9efaecb5884fb29ee87c8571fb.zip
[(new) Pass Manager] instantiate SimplifyCFG with the same options as the old PM
This is a recommit of r316869 which was speculatively reverted with r317444 and subsequently shown to not be the cause of PR35210. That crash should be fixed after r318237. Original commit message: The old PM sets the options of what used to be known as "latesimplifycfg" on the instantiation after the vectorizers have run, so that's what we'redoing here. FWIW, there's a later SimplifyCFGPass instantiation in both PMs where we do not set the "late" options. I'm not sure if that's intentional or not. Differential Revision: https://reviews.llvm.org/D39407 llvm-svn: 318299
Diffstat (limited to 'llvm/lib/Passes')
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index c9b4acfe3da..7235a885184 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -757,8 +757,13 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
// Optimize parallel scalar instruction chains into SIMD instructions.
OptimizePM.addPass(SLPVectorizerPass());
- // Cleanup after all of the vectorizers.
- OptimizePM.addPass(SimplifyCFGPass());
+ // Cleanup after all of the vectorizers. Simplification passes like CVP and
+ // GVN, loop transforms, and others have already run, so it's now better to
+ // convert to more optimized IR using more aggressive simplify CFG options.
+ OptimizePM.addPass(SimplifyCFGPass(SimplifyCFGOptions().
+ forwardSwitchCondToPhi(true).
+ convertSwitchToLookupTable(true).
+ needCanonicalLoops(false)));
OptimizePM.addPass(InstCombinePass());
// Unroll small loops to hide loop backedge latency and saturate any parallel
OpenPOWER on IntegriCloud