[llvm] [VPlan] Manage noalias/alias_scope metadata in VPlan. (NFC) (PR #136450)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat May 3 03:20:55 PDT 2025


================
@@ -75,15 +75,19 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
         assert(!isa<PHINode>(Inst) && "phis should be handled above");
         // Create VPWidenMemoryRecipe for loads and stores.
         if (LoadInst *Load = dyn_cast<LoadInst>(Inst)) {
+          SmallVector<std::pair<unsigned, MDNode *>> Metadata;
+          ::getMetadataToPropagate(Inst, Metadata);
           NewRecipe = new VPWidenLoadRecipe(
               *Load, Ingredient.getOperand(0), nullptr /*Mask*/,
-              false /*Consecutive*/, false /*Reverse*/,
+              false /*Consecutive*/, false /*Reverse*/, Metadata,
               Ingredient.getDebugLoc());
         } else if (StoreInst *Store = dyn_cast<StoreInst>(Inst)) {
+          SmallVector<std::pair<unsigned, MDNode *>> Metadata;
+          ::getMetadataToPropagate(Inst, Metadata);
           NewRecipe = new VPWidenStoreRecipe(
               *Store, Ingredient.getOperand(1), Ingredient.getOperand(0),
               nullptr /*Mask*/, false /*Consecutive*/, false /*Reverse*/,
-              Ingredient.getDebugLoc());
+              Metadata, Ingredient.getDebugLoc());
----------------
fhahn wrote:

Yep, but this is only used for the native path, not sure if it is worth adding a separate constructor?

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


More information about the llvm-commits mailing list