Skip to content

Commit 71f2c1e

Browse files
committed
[VPlan] Use early exit in ::extractLastLaneOfFirstOperand (NFC).
Reduce indent level, as suggested in #136455.
1 parent 112014b commit 71f2c1e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,14 +1142,14 @@ void VPIRInstruction::extractLastLaneOfFirstOperand(VPBuilder &Builder) {
11421142
"can only update exiting operands to phi nodes");
11431143
assert(getNumOperands() > 0 && "must have at least one operand");
11441144
VPValue *Exiting = getOperand(0);
1145-
if (!Exiting->isLiveIn()) {
1146-
LLVMContext &Ctx = getInstruction().getContext();
1147-
auto &Plan = *getParent()->getPlan();
1148-
Exiting = Builder.createNaryOp(
1149-
VPInstruction::ExtractFromEnd,
1150-
{Exiting,
1151-
Plan.getOrAddLiveIn(ConstantInt::get(IntegerType::get(Ctx, 32), 1))});
1152-
}
1145+
if (Exiting->isLiveIn())
1146+
return;
1147+
1148+
LLVMContext &Ctx = getInstruction().getContext();
1149+
auto &Plan = *getParent()->getPlan();
1150+
Exiting = Builder.createNaryOp(VPInstruction::ExtractFromEnd,
1151+
{Exiting, Plan.getOrAddLiveIn(ConstantInt::get(
1152+
IntegerType::get(Ctx, 32), 1))});
11531153
setOperand(0, Exiting);
11541154
}
11551155

0 commit comments

Comments
 (0)