Skip to content

Commit ce92582

Browse files
committed
[VPlan] Use operands() driectly in VPInstruction::clone() (NFC).
There's no need to create temporary SmallVectors.
1 parent 5b7a5f7 commit ce92582

File tree

1 file changed

+4
-6
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,8 @@ class LLVM_ABI_FOR_TEST VPInstruction : public VPRecipeWithIRFlags,
11101110
VP_CLASSOF_IMPL(VPDef::VPInstructionSC)
11111111

11121112
VPInstruction *clone() override {
1113-
SmallVector<VPValue *, 2> Operands(operands());
1114-
auto *New =
1115-
new VPInstruction(Opcode, Operands, *this, *this, getDebugLoc(), Name);
1113+
auto *New = new VPInstruction(Opcode, operands(), *this, *this,
1114+
getDebugLoc(), Name);
11161115
if (getUnderlyingValue())
11171116
New->setUnderlyingValue(getUnderlyingInstr());
11181117
return New;
@@ -1226,10 +1225,9 @@ class VPInstructionWithType : public VPInstruction {
12261225
}
12271226

12281227
VPInstruction *clone() override {
1229-
SmallVector<VPValue *, 2> Operands(operands());
12301228
auto *New =
1231-
new VPInstructionWithType(getOpcode(), Operands, getResultType(), *this,
1232-
getDebugLoc(), getName());
1229+
new VPInstructionWithType(getOpcode(), operands(), getResultType(),
1230+
*this, getDebugLoc(), getName());
12331231
New->setUnderlyingValue(getUnderlyingValue());
12341232
return New;
12351233
}

0 commit comments

Comments
 (0)