[llvm] [VPlan] Update scalar induction resume values in VPlan. (PR #110577)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 14:18:31 PST 2024
================
@@ -7803,10 +7823,37 @@ 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.
+ // Create induction resume values and ResumePhis for the inductions in the
+ // epilogue loop in the VPlan for the epilogue vector loop.
----------------
fhahn wrote:
It can, at the cost of creating more bypass values than needed; in particular we only need resume values for widened inductions, other inductions resume from the canonical one which will get created separately.
I updated it for now, but there are some tests which need to be updated with the redundant phis (which previously got removed). Thinking about it now, we might have to create them all here, as an induction being widened in the main loop may not be widened in the epilogue.
https://github.com/llvm/llvm-project/pull/110577
More information about the llvm-commits
mailing list