[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:54 PDT 2025


================
@@ -2762,16 +2801,19 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
 /// to store to and an optional mask.
 struct VPWidenStoreRecipe final : public VPWidenMemoryRecipe {
   VPWidenStoreRecipe(StoreInst &Store, VPValue *Addr, VPValue *StoredVal,
-                     VPValue *Mask, bool Consecutive, bool Reverse, DebugLoc DL)
+                     VPValue *Mask, bool Consecutive, bool Reverse,
+                     MDArrayRef Metadata, DebugLoc DL)
       : VPWidenMemoryRecipe(VPDef::VPWidenStoreSC, Store, {Addr, StoredVal},
-                            Consecutive, Reverse, DL) {
+                            Consecutive, Reverse, Metadata, DL) {
     setMask(Mask);
   }
 
   VPWidenStoreRecipe *clone() override {
-    return new VPWidenStoreRecipe(cast<StoreInst>(Ingredient), getAddr(),
-                                  getStoredValue(), getMask(), Consecutive,
-                                  Reverse, getDebugLoc());
+    auto *Copy = new VPWidenStoreRecipe(
+        cast<StoreInst>(Ingredient), getAddr(), getStoredValue(), 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