[llvm] [Passes] Add option for LoopVersioningLICM pass. (PR #67107)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 07:44:11 PDT 2023
================
@@ -1293,6 +1298,21 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
if (RunPartialInlining)
MPM.addPass(PartialInlinerPass());
+ // Scheduling LoopVersioningLICM when inlining is over, because after that
+ // we may see more accurate aliasing. Reason to run this late is that too
+ // early versioning may prevent further inlining due to increase of code
+ // size. By placing it just after inlining other optimizations which runs
+ // later might get benefit of no-alias assumption in clone loop.
+ if (UseLoopVersioningLICM) {
+ MPM.addPass(createModuleToFunctionPassAdaptor(
+ createFunctionToLoopPassAdaptor(LoopVersioningLICMPass())));
+ MPM.addPass(
+ createModuleToFunctionPassAdaptor(createFunctionToLoopPassAdaptor(
+ LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
+ /*AllowSpeculation=*/true),
+ /*USeMemorySSA=*/true, /*UseBlockFrequencyInfo=*/false)));
+ }
----------------
nikic wrote:
Why did you only move the LICM pass, and not the LoopVersioningLICM pass as well?
https://github.com/llvm/llvm-project/pull/67107
More information about the llvm-commits
mailing list