================
@@ -1344,6 +1346,24 @@
PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
void PassBuilder::addVectorPasses(OptimizationLevel Level,
FunctionPassManager &FPM,
ThinOrFullLTOPhase LTOPhase) {
+ const bool IsFullLTO = LTOPhase == ThinOrFullLTOPhase::FullLTOPostLink;
+
+ if (!IsFullLTO && Level == OptimizationLevel::O3 && PTO.LoopUnrolling &&
+ EnableOuterLoopVecPrep) {
+ FPM.addPass(LoopUnrollForVectorizationPass());
+ FPM.addPass(ReassociatePass());
+ FPM.addPass(createFunctionToLoopPassAdaptor(
+ LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
+ /*AllowSpeculation=*/true),
+ /*UseMemorySSA=*/true));
+ FPM.addPass(GVNPass());
+ FPM.addPass(createFunctionToLoopPassAdaptor(
+ LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,
+ /*AllowSpeculation=*/true),
+ /*UseMemorySSA=*/true));
+ FPM.addPass(InstCombinePass());
----------------
nikic wrote:
This is running lots of additional passes even if no unrolling happened. If you
want to run extra passes you need to make them conditional on successful
unrolling.
But imho this is indication that the unroll happens too late.
https://github.com/llvm/llvm-project/pull/202444
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits