Skip to content

Commit 545228b

Browse files
committed
Add assertion on multiple evl-phi
1 parent 981589a commit 545228b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2413,13 +2413,22 @@ void VPlanTransforms::simplifyEVLIVs(VPlan &Plan) {
24132413
};
24142414

24152415
// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe
2416+
// There should be only one EVL PHI in the entire plan
2417+
VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
2418+
VPBasicBlock *EVLPhiBlock = nullptr;
2419+
24162420
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
24172421
vp_depth_first_shallow(Plan.getEntry())))
24182422
for (VPRecipeBase &R : VPBB->phis())
24192423
if (auto *PhiR = dyn_cast<VPEVLBasedIVPHIRecipe>(&R)) {
2420-
ConvertEVLPhi(Plan, VPBB, PhiR);
2421-
break;
2424+
assert(!EVLPhi && "Found multiple EVL PHIs - only one expected");
2425+
EVLPhi = PhiR;
2426+
EVLPhiBlock = VPBB;
24222427
}
2428+
2429+
// Process the single EVL PHI if found
2430+
if (EVLPhi)
2431+
ConvertEVLPhi(Plan, EVLPhiBlock, EVLPhi);
24232432
}
24242433

24252434
void VPlanTransforms::dropPoisonGeneratingRecipes(

0 commit comments

Comments
 (0)