Skip to content

Commit ce30391

Browse files
committed
!fixup, address comments.
1 parent 53c168b commit ce30391

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2437,21 +2437,18 @@ void VPlanTransforms::handleUncountableEarlyExit(
24372437
ExitIRI->addOperand(IncomingFromLatch);
24382438
ExitIRI->extractLastLaneOfOperand(MiddleBuilder);
24392439
}
2440+
2441+
auto IsVector = [](ElementCount VF) { return VF.isVector(); };
24402442
// Add the incoming value from the early exit.
2441-
if (!IncomingFromEarlyExit->isLiveIn()) {
2442-
// Limit range to scalar VF only, if the range contains the scalar VF.
2443-
bool IsVectorVF = LoopVectorizationPlanner::getDecisionAndClampRange(
2444-
[](ElementCount VF) { return VF.isVector(); }, Range);
2445-
2446-
if (IsVectorVF) {
2447-
VPValue *FirstActiveLane = EarlyExitB.createNaryOp(
2448-
VPInstruction::FirstActiveLane, {EarlyExitTakenCond}, nullptr,
2449-
"first.active.lane");
2450-
IncomingFromEarlyExit =
2451-
EarlyExitB.createNaryOp(Instruction::ExtractElement,
2452-
{IncomingFromEarlyExit, FirstActiveLane},
2453-
nullptr, "early.exit.value");
2454-
}
2443+
if (!IncomingFromEarlyExit->isLiveIn() &&
2444+
// Limit range to scalar VF only, if the range contains the scalar VF.
2445+
LoopVectorizationPlanner::getDecisionAndClampRange(IsVector, Range)) {
2446+
VPValue *FirstActiveLane = EarlyExitB.createNaryOp(
2447+
VPInstruction::FirstActiveLane, {EarlyExitTakenCond}, nullptr,
2448+
"first.active.lane");
2449+
IncomingFromEarlyExit = EarlyExitB.createNaryOp(
2450+
Instruction::ExtractElement, {IncomingFromEarlyExit, FirstActiveLane},
2451+
nullptr, "early.exit.value");
24552452
}
24562453
ExitIRI->addOperand(IncomingFromEarlyExit);
24572454
}

0 commit comments

Comments
 (0)