Skip to content

Commit 19ee3ee

Browse files
lukel97rorth
authored andcommitted
[VPlan] Convert to concrete recipes before dissolving loop regions. NFCI (llvm#141999)
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 a7794a4 commit 19ee3ee

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
@@ -7289,14 +7289,14 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
72897289
TTI.getRegisterBitWidth(TargetTransformInfo::RGK_FixedWidthVector));
72907290
VPlanTransforms::removeDeadRecipes(BestVPlan);
72917291

7292+
VPlanTransforms::convertToConcreteRecipes(BestVPlan,
7293+
*Legal->getWidestInductionType());
72927294
// Retrieve and store the middle block before dissolving regions. Regions are
72937295
// dissolved after optimizing for VF and UF, which completely removes unneeded
72947296
// loop regions first.
72957297
VPBasicBlock *MiddleVPBB =
72967298
BestVPlan.getVectorLoopRegion() ? BestVPlan.getMiddleBlock() : nullptr;
72977299
VPlanTransforms::dissolveLoopRegions(BestVPlan);
7298-
VPlanTransforms::convertToConcreteRecipes(BestVPlan,
7299-
*Legal->getWidestInductionType());
73007300
// Perform the actual loop transformation.
73017301
VPTransformState State(&TTI, BestVF, LI, DT, ILV.AC, ILV.Builder, &BestVPlan,
73027302
OrigLoop->getParentLoop(),

0 commit comments

Comments
 (0)