Skip to content

Commit 2cdcc4f

Browse files
committed
[VPlan] Allow cloning of VPWidenRecipe without underlying instr (NFC).
Update VPWidenRecipe::clone() to use the constructor w/o mandatory Instruction, to facilitate cloning VPWidenRecipe without underlying instructions. Split off from #148239.
1 parent 28e1e7e commit 2cdcc4f

File tree

1 file changed

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

1 file changed

+6
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,9 +1357,10 @@ class LLVM_ABI_FOR_TEST VPWidenRecipe : public VPRecipeWithIRFlags,
13571357

13581358
public:
13591359
VPWidenRecipe(unsigned Opcode, ArrayRef<VPValue *> Operands,
1360-
const VPIRFlags &Flags, DebugLoc DL)
1360+
const VPIRFlags &Flags, const VPIRMetadata &Metadata,
1361+
DebugLoc DL)
13611362
: VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, Flags, DL),
1362-
Opcode(Opcode) {}
1363+
VPIRMetadata(Metadata), Opcode(Opcode) {}
13631364

13641365
VPWidenRecipe(Instruction &I, ArrayRef<VPValue *> Operands)
13651366
: VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, I), VPIRMetadata(I),
@@ -1368,8 +1369,9 @@ class LLVM_ABI_FOR_TEST VPWidenRecipe : public VPRecipeWithIRFlags,
13681369
~VPWidenRecipe() override = default;
13691370

13701371
VPWidenRecipe *clone() override {
1371-
auto *R = new VPWidenRecipe(*getUnderlyingInstr(), operands());
1372-
R->transferFlags(*this);
1372+
auto *R =
1373+
new VPWidenRecipe(getOpcode(), operands(), *this, *this, getDebugLoc());
1374+
R->setUnderlyingValue(getUnderlyingValue());
13731375
return R;
13741376
}
13751377

0 commit comments

Comments
 (0)