[llvm] [VPlan] Remove VPWidenRecipe constructor with no underlying instruction. NFCI (PR #166521)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 5 01:15:56 PST 2025
================
@@ -1447,22 +1447,15 @@ class LLVM_ABI_FOR_TEST VPWidenRecipe : public VPRecipeWithIRFlags,
unsigned Opcode;
public:
- VPWidenRecipe(unsigned Opcode, ArrayRef<VPValue *> Operands,
- const VPIRFlags &Flags, const VPIRMetadata &Metadata,
- DebugLoc DL)
- : VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, Flags, DL),
- VPIRMetadata(Metadata), Opcode(Opcode) {}
-
VPWidenRecipe(Instruction &I, ArrayRef<VPValue *> Operands)
: VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, I), VPIRMetadata(I),
Opcode(I.getOpcode()) {}
~VPWidenRecipe() override = default;
VPWidenRecipe *clone() override {
- auto *R =
- new VPWidenRecipe(getOpcode(), operands(), *this, *this, getDebugLoc());
- R->setUnderlyingValue(getUnderlyingValue());
+ auto *R = new VPWidenRecipe(*getUnderlyingInstr(), operands());
----------------
lukel97 wrote:
I did a quick check and the metadata doesn't ever seem to change from the underlying instruction. So I think it's fine to just let the Instruction constructor set the VPIRMetadata. The flags change however so we need to transfer that.
https://github.com/llvm/llvm-project/pull/166521
More information about the llvm-commits
mailing list