[llvm] [VectorUtils] Add helper to get list of metadata to propagate (NFC). (PR #135003)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 11:08:39 PDT 2025


================
@@ -984,19 +984,38 @@ MDNode *llvm::intersectAccessGroups(const Instruction *Inst1,
   return MDNode::get(Ctx, Intersection);
 }
 
+/// Add metadata from \p Inst to \p Metadata, if it can be preserved after
+/// vectorization.
+static void getMetadataToPropagate(
+    Instruction *Inst,
+    SmallVectorImpl<std::pair<unsigned, MDNode *>> &Metadata) {
+  Inst->getAllMetadataOtherThanDebugLoc(Metadata);
+  unsigned SupportedIDs[] = {
----------------
arsenm wrote:

static const? 

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


More information about the llvm-commits mailing list