[llvm] [VPlan] Update scalar induction resume values in VPlan. (PR #110577)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 16:05:14 PST 2024


================
@@ -10324,7 +10343,13 @@ bool LoopVectorizePass::processLoop(Loop *L) {
         LVP.executePlan(EPI.EpilogueVF, EPI.EpilogueUF, BestEpiPlan, EpilogILV,
                         DT, true, &ExpandedSCEVs);
         ++LoopsEpilogueVectorized;
+        BasicBlock *PH = L->getLoopPreheader();
 
+        for (const auto &[IVPhi, _] : LVL.getInductionVars()) {
+          auto *Inc = cast<PHINode>(IVPhi->getIncomingValueForBlock(PH));
+          const auto &[BB, V] = EpilogILV.getInductionBypassValue(IVPhi);
+          Inc->setIncomingValueForBlock(BB, V);
+        }
----------------
ayalz wrote:

Could this be taken care of by LVP.executePlan() above rather than here in LoopVectorizePass::processLoop()?

https://github.com/llvm/llvm-project/pull/110577


More information about the llvm-commits mailing list