diff options
author | Florian Hahn <flo@fhahn.com> | 2025-07-17 10:42:34 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2025-07-17 10:42:34 +0100 |
commit | 2cdcc4f2c6a0d36a5b534e16d5892ff8b03f3c88 (patch) | |
tree | 3dc5075a760f610eb5107f1d49f1c1206d6f678e | |
parent | 28e1e7e1b4b059a2e42f68061475cddb4ad0a6a3 (diff) | |
download | llvm-2cdcc4f2c6a0d36a5b534e16d5892ff8b03f3c88.zip llvm-2cdcc4f2c6a0d36a5b534e16d5892ff8b03f3c88.tar.gz llvm-2cdcc4f2c6a0d36a5b534e16d5892ff8b03f3c88.tar.bz2 |
[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 https://github.com/llvm/llvm-project/pull/148239.
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlan.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 703cfe9..204268e 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -1357,9 +1357,10 @@ class LLVM_ABI_FOR_TEST VPWidenRecipe : public VPRecipeWithIRFlags, public: VPWidenRecipe(unsigned Opcode, ArrayRef<VPValue *> Operands, - const VPIRFlags &Flags, DebugLoc DL) + const VPIRFlags &Flags, const VPIRMetadata &Metadata, + DebugLoc DL) : VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, Flags, DL), - Opcode(Opcode) {} + VPIRMetadata(Metadata), Opcode(Opcode) {} VPWidenRecipe(Instruction &I, ArrayRef<VPValue *> Operands) : VPRecipeWithIRFlags(VPDef::VPWidenSC, Operands, I), VPIRMetadata(I), @@ -1368,8 +1369,9 @@ public: ~VPWidenRecipe() override = default; VPWidenRecipe *clone() override { - auto *R = new VPWidenRecipe(*getUnderlyingInstr(), operands()); - R->transferFlags(*this); + auto *R = + new VPWidenRecipe(getOpcode(), operands(), *this, *this, getDebugLoc()); + R->setUnderlyingValue(getUnderlyingValue()); return R; } |