[llvm] [VPlan] Use VPIRMetadata for VPInterleaveRecipe. (PR #153084)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 11:51:56 PDT 2025


================
@@ -1491,6 +1491,17 @@ void VPIRMetadata::applyMetadata(Instruction &I) const {
     I.setMetadata(Kind, Node);
 }
 
+void VPIRMetadata::intersect(const VPIRMetadata &Other) {
+  SmallVector<std::pair<unsigned, MDNode *>> MetadataUnion;
+  for (const auto &[KindA, MDA] : Metadata) {
+    for (const auto &[KindB, MDB] : Other.Metadata) {
----------------
ayalz wrote:

Ok, deserves a note.
Sure the entries are unsorted, and expected to be few. Thought of retaining SmallVectors but erasing from a copy of Other every matched entry, iterating over both in reverse, aiming to be linear in (the frequent?) case the two metadata are ordered similarly and their intersection is large.

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


More information about the llvm-commits mailing list