[llvm] [VPlan] Update scalar induction resume values in VPlan. (PR #110577)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 23:56:01 PST 2024
================
@@ -7820,10 +7847,15 @@ EpilogueVectorizerMainLoop::createEpilogueVectorizedLoopSkeleton(
// Generate the induction variable.
EPI.VectorTripCount = getOrCreateVectorTripCount(LoopVectorPreHeader);
- // Skip induction resume value creation here because they will be created in
- // the second pass for the scalar loop. The induction resume values for the
- // inductions in the epilogue loop are created before executing the plan for
- // the epilogue loop.
+ // Generate VPValues and ResumePhi recipes for inductions in the epilogue loop
+ // to resume from the main loop or bypass it, if there are any wide
+ // inductions. Otherwise it is we only need a resume value for the canonical
+ // induction, which will get created during epilogue skeleton construction.
+ if (any_of(
+ EPI.EpiloguePlan.getVectorLoopRegion()->getEntryBasicBlock()->phis(),
+ IsaPred<VPWidenIntOrFpInductionRecipe,
+ VPWidenPointerInductionRecipe>))
----------------
ayalz wrote:
Worth collecting all original induction phi nodes that get widen in the epilog, and pass that set to createInductionResumeValues(), rather than checking if the set is empty and gating this function?
https://github.com/llvm/llvm-project/pull/110577
More information about the llvm-commits
mailing list