Skip to content

Commit 016194c

Browse files
committed
Add assertion on multiple evl-phi
1 parent a4c9206 commit 016194c

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
@@ -2409,13 +2409,22 @@ void VPlanTransforms::simplifyEVLIVs(VPlan &Plan) {
24092409
};
24102410

24112411
// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe
2412+
// There should be only one EVL PHI in the entire plan
2413+
VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
2414+
VPBasicBlock *EVLPhiBlock = nullptr;
2415+
24122416
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
24132417
vp_depth_first_shallow(Plan.getEntry())))
24142418
for (VPRecipeBase &R : VPBB->phis())
24152419
if (auto *PhiR = dyn_cast<VPEVLBasedIVPHIRecipe>(&R)) {
2416-
ConvertEVLPhi(Plan, VPBB, PhiR);
2417-
break;
2420+
assert(!EVLPhi && "Found multiple EVL PHIs - only one expected");
2421+
EVLPhi = PhiR;
2422+
EVLPhiBlock = VPBB;
24182423
}
2424+
2425+
// Process the single EVL PHI if found
2426+
if (EVLPhi)
2427+
ConvertEVLPhi(Plan, EVLPhiBlock, EVLPhi);
24192428
}
24202429

24212430
void VPlanTransforms::dropPoisonGeneratingRecipes(

0 commit comments

Comments
 (0)