[llvm] [VPlan] Use ResumePhi to create reduction resume phis. (PR #110004)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 13 14:00:27 PDT 2024
================
@@ -7617,11 +7600,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)
+ for (VPRecipeBase &R : *ExitVPBB) {
+ updateAndCollectMergePhiForReductionForEpilogueVectorization(
+ dyn_cast<VPInstruction>(&R), State, OrigLoop,
+ State.CFG.VPBB2IRBB[ExitVPBB], ExpandedSCEVs);
----------------
fhahn wrote:
ExpandedSCEVS indicates that we are vectorizing the epilogue vector loop and `IsEpilogueVectorization` is true if either main or epilogue loop is vectorized during epilogue vectorization . Added to check above, removed from function
https://github.com/llvm/llvm-project/pull/110004
More information about the llvm-commits
mailing list