Skip to content

Commit

Permalink
[PassBuilder][PassManagerBuilder] Run LICM before loop spawning to en…
Browse files Browse the repository at this point in the history
…sure loop-invariant conditions appear outside of the loop. Addresses llvm#66.
  • Loading branch information
neboat authored and tarunprabhu committed Sep 26, 2023
1 parent 34cc5aa commit 92fdd17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Passes/PassBuilderPipelines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,8 @@ PassBuilder::buildTapirLoweringPipeline(OptimizationLevel Level,
// Rotate Loop - disable header duplication at -Oz
LPM1.addPass(LoopRotatePass(Level != OptimizationLevel::Oz));
LPM2.addPass(IndVarSimplifyPass());
LPM2.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap));
LPM2.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
/*AllowSpeculation=*/true));

FunctionPassManager FPM;
FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1),
Expand Down

0 comments on commit 92fdd17

Please sign in to comment.