In https://reviews.llvm.org/D88138 this was incorrectly added with
registerOptimizerLastEPCallback(), when it should be
registerLoopOptimizerEndEPCallback(), matching the legacy PM's
EP_LoopOptimizerEnd.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
@asbirlea I remember that HexagonVLCR pass has a dependency on LCSSA and LoopSimplifyPass. Is there any way we can run these passes too at LoopOptimizerEndEP? If not maybe use another EP for legacy PM? I'm not sure if the below code would run these passes in the correct order as well
PB.registerOptimizerLastEPCallback( [=](ModulePassManager &MPM, PassBuilder::OptimizationLevel Level) { LoopPassManager LPM(DebugPassManager); FunctionPassManager FPM(DebugPassManager); LPM.addPass(HexagonVectorLoopCarriedReusePass()); FPM.addPass(LoopSimplifyPass()); FPM.addPass(LCSSAPass()); FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM))); MPM.addPass(createModuleToFunctionPassAdaptor(std::move(FPM))); });
@pranavb Can you comment more on this?
Comment Actions
LCSSA should be preserved by all loop passes under the new PM. LCSSA and LoopSimplify are run before any loop pass: https://github.com/llvm/llvm-project/blob/8dddcc762dd98d53b9406b36e92f62502834187c/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h#L406. Although I don't think passes are required preserve loop simplify form.
Yep.