Skip to content

Commit 3f7409b

Browse files
committed
Add assertion on multiple evl-phi
1 parent 97a3cfb commit 3f7409b

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

24072407
// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe
2408+
// There should be only one EVL PHI in the entire plan
2409+
VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
2410+
VPBasicBlock *EVLPhiBlock = nullptr;
2411+
24082412
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
24092413
vp_depth_first_shallow(Plan.getEntry())))
24102414
for (VPRecipeBase &R : VPBB->phis())
24112415
if (auto *PhiR = dyn_cast<VPEVLBasedIVPHIRecipe>(&R)) {
2412-
ConvertEVLPhi(Plan, VPBB, PhiR);
2413-
break;
2416+
assert(!EVLPhi && "Found multiple EVL PHIs - only one expected");
2417+
EVLPhi = PhiR;
2418+
EVLPhiBlock = VPBB;
24142419
}
2420+
2421+
// Process the single EVL PHI if found
2422+
if (EVLPhi)
2423+
ConvertEVLPhi(Plan, EVLPhiBlock, EVLPhi);
24152424
}
24162425

24172426
void VPlanTransforms::dropPoisonGeneratingRecipes(

0 commit comments

Comments
 (0)