Skip to content

Commit 70c4fc1

Browse files
committed
[VPlan] Convert to concrete recipes before dissolving loop regions. NFCI
After updating llvm#118638 on tip of tree, expanding VPWidenIntOrFpInductionRecipes fails because it needs the loop region to get the latch to insert the increment into: VPBasicBlock *ExitingBB = Plan->getVectorLoopRegion()->getExitingBasicBlock(); Builder.setInsertPoint(ExitingBB, ExitingBB->getTerminator()->getIterator()); auto *Next = Builder.createNaryOp(AddOp, {Prev, Inc}, Flags, WidenIVR->getDebugLoc(), "vec.ind.next"); However after llvm#117506, the region is dissolved so it doesn't work. This shuffles the dissolveLoopRegions steps to be after convertToConcreteRecipes so we can use the region when expanding VPWidenIntOrFpInductionRecipes
1 parent c842705 commit 70c4fc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7568,14 +7568,14 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
75687568
TTI.getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector));
75697569
VPlanTransforms::removeDeadRecipes(BestVPlan);
75707570

7571+
VPlanTransforms::convertToConcreteRecipes(BestVPlan,
7572+
*Legal->getWidestInductionType());
75717573
// Retrieve and store the middle block before dissolving regions. Regions are
75727574
// dissolved after optimizing for VF and UF, which completely removes unneeded
75737575
// loop regions first.
75747576
VPBasicBlock *MiddleVPBB =
75757577
BestVPlan.getVectorLoopRegion() ? BestVPlan.getMiddleBlock() : nullptr;
75767578
VPlanTransforms::dissolveLoopRegions(BestVPlan);
7577-
VPlanTransforms::convertToConcreteRecipes(BestVPlan,
7578-
*Legal->getWidestInductionType());
75797579
// Perform the actual loop transformation.
75807580
VPTransformState State(&TTI, BestVF, LI, DT, ILV.AC, ILV.Builder, &BestVPlan,
75817581
OrigLoop->getParentLoop(),

0 commit comments

Comments
 (0)