Skip to content

Commit 0f992a3

Browse files
committed
[VPlan] Don't collect live-ins in collectUsersInExitBlocks. (NFC)
Live-ins don't need to be handled, other than adding to the exit phi recipe. Do that early and assert that otherwise the exit value is defined in the vector loop region. This should enable simply skipping other exit values that do not need further fixing, e.g. if handling the exit value from the early exit directly in handleUncountableEarlyExit.
1 parent 662133a commit 0f992a3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9052,8 +9052,12 @@ collectUsersInExitBlocks(Loop *OrigLoop, VPRecipeBuilder &Builder,
90529052
}
90539053
Value *IncomingValue = ExitPhi->getIncomingValueForBlock(ExitingBB);
90549054
VPValue *V = Builder.getVPValueOrAddLiveIn(IncomingValue);
9055-
ExitUsersToFix.insert(ExitIRI);
90569055
ExitIRI->addOperand(V);
9056+
if (V->isLiveIn())
9057+
continue;
9058+
assert(V->getDefiningRecipe()->getParent()->getEnclosingLoopRegion() &&
9059+
"Only recipes defined inside a region should need fixing.");
9060+
ExitUsersToFix.insert(ExitIRI);
90579061
}
90589062
}
90599063
}
@@ -9077,11 +9081,6 @@ addUsersInExitBlocks(VPlan &Plan,
90779081
// modeling the corresponding LCSSA phis.
90789082
for (VPIRInstruction *ExitIRI : ExitUsersToFix) {
90799083
for (const auto &[Idx, Op] : enumerate(ExitIRI->operands())) {
9080-
// Pass live-in values used by exit phis directly through to their users
9081-
// in the exit block.
9082-
if (Op->isLiveIn())
9083-
continue;
9084-
90859084
// Currently only live-ins can be used by exit values from blocks not
90869085
// exiting via the vector latch through to the middle block.
90879086
if (ExitIRI->getParent()->getSinglePredecessor() != MiddleVPBB)

0 commit comments

Comments
 (0)