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

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 16 11:34:50 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:

Thoughts about reducing the O(|Metadata|*|Other.Metadata|) complexity here? Perhaps working with a temporary copy of Other.Metadata and erasing from it every element that is matched, which would work better if both Metadata and Other.Metadata are scanned in reverse, for the common case(?) where they are equal?

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


More information about the llvm-commits mailing list