Skip to content

Commit 64e8908

Browse files
committed
Address comments
1 parent 73f8609 commit 64e8908

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,16 +1307,15 @@ void VPlanTransforms::addActiveLaneMask(
13071307
/// ...
13081308
///
13091309
bool VPlanTransforms::addExplicitVectorLength(VPlan &Plan) {
1310-
// EVL transform doesn't support backends where EVL diffs from RuntimeVF
1311-
// in the second-to-last iteration.
1312-
// Return false if any recipes rely on RuntimeVF.
1313-
if (any_of(Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis(),
1314-
[](VPRecipeBase &Phi) {
1315-
return (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
1316-
isa<VPWidenPointerInductionRecipe>(&Phi));
1317-
}))
1318-
return false;
13191310
VPBasicBlock *Header = Plan.getVectorLoopRegion()->getEntryBasicBlock();
1311+
// The transform updates all users of inductions to work based on EVL, instead
1312+
// of the VF directly. At the moment, widened inductions cannot be updated, so
1313+
// bail out if the plan contains any.
1314+
if (any_of(Header->phis(), [](VPRecipeBase &Phi) {
1315+
return (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
1316+
isa<VPWidenPointerInductionRecipe>(&Phi));
1317+
}))
1318+
return false;
13201319
auto *CanonicalIVPHI = Plan.getCanonicalIV();
13211320
VPValue *StartV = CanonicalIVPHI->getStartValue();
13221321

0 commit comments

Comments
 (0)