Skip to content

Commit 8a47d08

Browse files
committed
Add assertion on multiple evl-phi
1 parent 5f8cde2 commit 8a47d08

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

24322432
// Find EVL loop entries by locating VPEVLBasedIVPHIRecipe
2433+
// There should be only one EVL PHI in the entire plan
2434+
VPEVLBasedIVPHIRecipe *EVLPhi = nullptr;
2435+
VPBasicBlock *EVLPhiBlock = nullptr;
2436+
24332437
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
24342438
vp_depth_first_shallow(Plan.getEntry())))
24352439
for (VPRecipeBase &R : VPBB->phis())
24362440
if (auto *PhiR = dyn_cast<VPEVLBasedIVPHIRecipe>(&R)) {
2437-
ConvertEVLPhi(Plan, VPBB, PhiR);
2438-
break;
2441+
assert(!EVLPhi && "Found multiple EVL PHIs - only one expected");
2442+
EVLPhi = PhiR;
2443+
EVLPhiBlock = VPBB;
24392444
}
2445+
2446+
// Process the single EVL PHI if found
2447+
if (EVLPhi)
2448+
ConvertEVLPhi(Plan, EVLPhiBlock, EVLPhi);
24402449
}
24412450

24422451
void VPlanTransforms::dropPoisonGeneratingRecipes(

0 commit comments

Comments
 (0)