diff options
| author | Michael Kruse <llvm@meinersbur.de> | 2017-09-09 21:43:49 +0000 |
|---|---|---|
| committer | Michael Kruse <llvm@meinersbur.de> | 2017-09-09 21:43:49 +0000 |
| commit | 0481d78c6c0f0c3bc87df4cea195d01897c8a189 (patch) | |
| tree | e650bb2b6689bbfdda82f3a8edeab88d96276c83 /polly/lib/CodeGen/CodegenCleanup.cpp | |
| parent | ed27bea373ad51cc3ca945e7bc16c6fd7fb66854 (diff) | |
| download | bcm5719-llvm-0481d78c6c0f0c3bc87df4cea195d01897c8a189.tar.gz bcm5719-llvm-0481d78c6c0f0c3bc87df4cea195d01897c8a189.zip | |
[CodegenCleanup] Update cleanup passes according (old) PassManagerBuilder.
Update CodegenCleanup using the function-level passes added by
populatePassManager that run between EP_EarlyAsPossible and
EP_VectorizerStart in -O3.
The changes in particular are:
- Added pass create arguments, e.g. ExpensiveCombines for InstCombine.
- Remove reroll pass. The option -reroll-loops is disabled by default.
- Add passes run with UnitAtATime, which is the default.
- Add instances of LibCallsShrinkWrap, TailCallElimination, SCCP
(sparse conditional constant propagation), Float2Int
that did not run before.
- Add instances of GVN as in the default pipeline.
Notes:
- GVNHoist, GVNSink, NewGVN are still disabled in the -O3 pipeline.
- The optimization level and other optimization parameters are not
accessible outside of PassManagerBuilder, hence we cannot add passes
depending on these.
Differential Revision: https://reviews.llvm.org/D37571
llvm-svn: 312875
Diffstat (limited to 'polly/lib/CodeGen/CodegenCleanup.cpp')
| -rw-r--r-- | polly/lib/CodeGen/CodegenCleanup.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/polly/lib/CodeGen/CodegenCleanup.cpp b/polly/lib/CodeGen/CodegenCleanup.cpp index fd3dea25adb..f5a5744d519 100644 --- a/polly/lib/CodeGen/CodegenCleanup.cpp +++ b/polly/lib/CodeGen/CodegenCleanup.cpp @@ -62,36 +62,46 @@ public: FPM->add(createCFGSimplificationPass()); FPM->add(createSROAPass()); FPM->add(createEarlyCSEPass()); - FPM->add(createInstructionCombiningPass()); + + FPM->add(createPromoteMemoryToRegisterPass()); + FPM->add(createInstructionCombiningPass(true)); + FPM->add(createCFGSimplificationPass()); + FPM->add(createSROAPass()); + FPM->add(createEarlyCSEPass(true)); + FPM->add(createSpeculativeExecutionIfHasBranchDivergencePass()); FPM->add(createJumpThreadingPass()); FPM->add(createCorrelatedValuePropagationPass()); FPM->add(createCFGSimplificationPass()); - FPM->add(createInstructionCombiningPass()); + FPM->add(createInstructionCombiningPass(true)); + FPM->add(createLibCallsShrinkWrapPass()); + FPM->add(createTailCallEliminationPass()); FPM->add(createCFGSimplificationPass()); FPM->add(createReassociatePass()); - FPM->add(createLoopRotatePass()); + FPM->add(createLoopRotatePass(-1)); FPM->add(createGVNPass()); FPM->add(createLICMPass()); FPM->add(createLoopUnswitchPass()); FPM->add(createCFGSimplificationPass()); - FPM->add(createInstructionCombiningPass()); + FPM->add(createInstructionCombiningPass(true)); FPM->add(createIndVarSimplifyPass()); FPM->add(createLoopIdiomPass()); FPM->add(createLoopDeletionPass()); FPM->add(createCFGSimplificationPass()); - FPM->add(createSimpleLoopUnrollPass()); + FPM->add(createSimpleLoopUnrollPass(3)); FPM->add(createMergedLoadStoreMotionPass()); + FPM->add(createGVNPass()); FPM->add(createMemCpyOptPass()); + FPM->add(createSCCPPass()); FPM->add(createBitTrackingDCEPass()); - FPM->add(createInstructionCombiningPass()); + FPM->add(createInstructionCombiningPass(true)); FPM->add(createJumpThreadingPass()); FPM->add(createCorrelatedValuePropagationPass()); FPM->add(createDeadStoreEliminationPass()); FPM->add(createLICMPass()); - FPM->add(createLoopRerollPass()); FPM->add(createAggressiveDCEPass()); FPM->add(createCFGSimplificationPass()); - FPM->add(createInstructionCombiningPass()); + FPM->add(createInstructionCombiningPass(true)); + FPM->add(createFloat2IntPass()); return FPM->doInitialization(); } |

