diff options
Diffstat (limited to 'llvm/lib/Passes')
| -rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index 8b9962af38c..9fdcbc5a234 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -390,13 +390,21 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level, // Add the primary loop simplification pipeline. // FIXME: Currently this is split into two loop pass pipelines because we run - // some function passes in between them. These can and should be replaced by - // loop pass equivalenst but those aren't ready yet. Specifically, - // `SimplifyCFGPass` and `InstCombinePass` are used. We have - // `LoopSimplifyCFGPass` which isn't yet powerful enough, and the closest to - // the other we have is `LoopInstSimplify`. + // some function passes in between them. These can and should be removed + // and/or replaced by scheduling the loop pass equivalents in the correct + // positions. But those equivalent passes aren't powerful enough yet. + // Specifically, `SimplifyCFGPass` and `InstCombinePass` are currently still + // used. We have `LoopSimplifyCFGPass` which isn't yet powerful enough yet to + // fully replace `SimplifyCFGPass`, and the closest to the other we have is + // `LoopInstSimplify`. LoopPassManager LPM1(DebugLogging), LPM2(DebugLogging); + // Simplify the loop body. We do this initially to clean up after other loop + // passes run, either when iterating on a loop or on inner loops with + // implications on the outer loop. + LPM1.addPass(LoopInstSimplifyPass()); + LPM1.addPass(LoopSimplifyCFGPass()); + // Rotate Loop - disable header duplication at -Oz LPM1.addPass(LoopRotatePass(Level != Oz)); LPM1.addPass(LICMPass()); |

