[llvm] [VPlan] Use ResumePhi to create reduction resume phis. (PR #110004)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 11:59:05 PDT 2024


================
@@ -7645,11 +7627,12 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
   // 2.5 Collect reduction resume values.
   auto *ExitVPBB =
       cast<VPBasicBlock>(BestVPlan.getVectorLoopRegion()->getSingleSuccessor());
-  for (VPRecipeBase &R : *ExitVPBB) {
-    createAndCollectMergePhiForReduction(
-        dyn_cast<VPInstruction>(&R), State, OrigLoop,
-        State.CFG.VPBB2IRBB[ExitVPBB], ExpandedSCEVs);
-  }
+  if (IsEpilogueVectorization && ExpandedSCEVs)
----------------
fhahn wrote:

Adjusted in 9648271a3c5adf875680833ac74eb4bafb48678d to only set the flag if the epilogue is vectorized.

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


More information about the llvm-commits mailing list