@@ -8544,20 +8544,11 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
8544
8544
// Return false if the vector region has recipes relying on
8545
8545
// RuntimeVF.
8546
8546
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
+ }))
8561
8552
return false ;
8562
8553
return true ;
8563
8554
}
@@ -8577,7 +8568,7 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
8577
8568
VPlanTransforms::optimize (*Plan, *PSE.getSE ());
8578
8569
// TODO: try to put it close to addActiveLaneMask().
8579
8570
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
8581
8572
if (!isCompatibleToEVLTransform (*Plan))
8582
8573
break ;
8583
8574
VPlanTransforms::addExplicitVectorLength (*Plan);
0 commit comments