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

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 09:02:12 PST 2024


================
@@ -7724,13 +7739,22 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
 
   BestVPlan.execute(&State);
 
-  // 2.5 Collect reduction resume values.
   auto *ExitVPBB = BestVPlan.getMiddleBlock();
-  if (VectorizingEpilogue)
+  // 2.5 When vectorizing the epilogue, fix reduction and induction resume
+  // values from the additional bypass block.
+  if (VectorizingEpilogue) {
+    BasicBlock *BypassBlock = ILV.getInductionAdditionalBypassBlock();
----------------
ayalz wrote:

BypassBlock also feeds reduction resumes in addition to inductions. Better retrieve it from ILV via a more general `getAdditionalBypassBlock()`?

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


More information about the llvm-commits mailing list