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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 08:11:40 PDT 2025


================
@@ -2752,10 +2762,10 @@ void VPWidenLoadRecipe::execute(VPTransformState &State) {
     NewLI = Builder.CreateAlignedLoad(DataTy, Addr, Alignment, "wide.load");
   }
   // Add metadata to the load, but setVectorValue to the reverse shuffle.
-  State.addMetadata(NewLI, LI);
-  if (Reverse)
-    NewLI = Builder.CreateVectorReverse(NewLI, "reverse");
-  State.set(this, NewLI);
+  State.addNewMetadata(NewLI, LI);
+  applyMetadata(*NewLI);
+  State.set(this,
+            Reverse ? Builder.CreateVectorReverse(NewLI, "reverse") : NewLI);
----------------
fhahn wrote:

Yes, otherwise we need to cast, could also change if desired

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


More information about the llvm-commits mailing list