Skip to content

Commit e165225

Browse files
committed
[VPlan] Simplify check in collectUsersInLatchExitBlock. (NFC)
Unswitch the check in collectUsersInLatchExitBlock as suggested in #136455. The assertion is now checked by the verifier since aadf35c.
1 parent c50cba6 commit e165225

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9193,15 +9193,12 @@ static void addScalarResumePhis(VPRecipeBuilder &Builder, VPlan &Plan,
91939193
static SetVector<VPIRInstruction *> collectUsersInLatchExitBlock(VPlan &Plan) {
91949194
SetVector<VPIRInstruction *> ExitUsersToFix;
91959195
for (VPIRBasicBlock *ExitVPBB : Plan.getExitBlocks()) {
9196+
9197+
if (ExitVPBB->getSinglePredecessor() != Plan.getMiddleBlock())
9198+
continue;
9199+
91969200
for (VPRecipeBase &R : ExitVPBB->phis()) {
91979201
auto *ExitIRI = cast<VPIRPhi>(&R);
9198-
if (ExitVPBB->getSinglePredecessor() != Plan.getMiddleBlock()) {
9199-
assert(ExitIRI->getNumOperands() ==
9200-
ExitVPBB->getPredecessors().size() &&
9201-
"early-exit must update exit values on construction");
9202-
continue;
9203-
}
9204-
92059202
assert(ExitIRI->getNumOperands() == 1 && "must have a single operand");
92069203
VPValue *V = ExitIRI->getOperand(0);
92079204
if (V->isLiveIn())

0 commit comments

Comments
 (0)