Skip to content

Commit 07a62be

Browse files
committed
Address comments
1 parent a86656d commit 07a62be

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8544,20 +8544,11 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
85448544
// Return false if the vector region has recipes relying on
85458545
// RuntimeVF.
85468546
static bool isCompatibleToEVLTransform(VPlan &Plan) {
8547-
auto HasAnyRuntimeVFUserInLoop = [](VPlan &Plan) -> bool {
8548-
for (auto &Phi : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis())
8549-
if (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
8550-
isa<VPWidenPointerInductionRecipe>(&Phi))
8551-
return true;
8552-
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
8553-
vp_depth_first_deep(Plan.getVectorLoopRegion())))
8554-
for (VPRecipeBase &Recipe : *VPBB)
8555-
if (auto *VecPtrR = dyn_cast<VPVectorPointerRecipe>(&Recipe))
8556-
if (VecPtrR->isReverse())
8557-
return true;
8558-
return false;
8559-
};
8560-
if (HasAnyRuntimeVFUserInLoop(Plan))
8547+
if (any_of(Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis(),
8548+
[](VPRecipeBase &Phi) {
8549+
return (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
8550+
isa<VPWidenPointerInductionRecipe>(&Phi));
8551+
}))
85618552
return false;
85628553
return true;
85638554
}
@@ -8577,7 +8568,7 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
85778568
VPlanTransforms::optimize(*Plan, *PSE.getSE());
85788569
// TODO: try to put it close to addActiveLaneMask().
85798570
if (CM.foldTailWithEVL()) {
8580-
// Don't generate plan if the plan is not EVL-compatible
8571+
// Discard the plan if it is not EVL-compatible
85818572
if (!isCompatibleToEVLTransform(*Plan))
85828573
break;
85838574
VPlanTransforms::addExplicitVectorLength(*Plan);

0 commit comments

Comments
 (0)