[llvm] [VPlan] Manage instruction medata in VPlan. (PR #135272)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 19 12:27:53 PDT 2025


================
@@ -2684,17 +2719,20 @@ class VPWidenMemoryRecipe : public VPRecipeBase {
 /// optional mask.
 struct VPWidenLoadRecipe final : public VPWidenMemoryRecipe, public VPValue {
   VPWidenLoadRecipe(LoadInst &Load, VPValue *Addr, VPValue *Mask,
-                    bool Consecutive, bool Reverse, DebugLoc DL)
+                    bool Consecutive, bool Reverse, MDArrayRef Metadata,
+                    DebugLoc DL)
       : VPWidenMemoryRecipe(VPDef::VPWidenLoadSC, Load, {Addr}, Consecutive,
-                            Reverse, DL),
+                            Reverse, Metadata, DL),
         VPValue(this, &Load) {
     setMask(Mask);
   }
 
   VPWidenLoadRecipe *clone() override {
-    return new VPWidenLoadRecipe(cast<LoadInst>(Ingredient), getAddr(),
-                                 getMask(), Consecutive, Reverse,
-                                 getDebugLoc());
+    auto *Copy = new VPWidenLoadRecipe(cast<LoadInst>(Ingredient), getAddr(),
+                                       getMask(), Consecutive, Reverse,
+                                       getMetadata(), getDebugLoc());
+    Copy->addMetadata(getMetadata());
----------------
fhahn wrote:

Yep this was left over from an earlier version, removed, thanks!

https://github.com/llvm/llvm-project/pull/135272


More information about the llvm-commits mailing list