[llvm] [TableGen][GlobalISel] Add rule-wide type inference (PR #66377)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 22:10:15 PST 2023


================
@@ -125,6 +130,20 @@ template <typename Container> auto values(Container &&C) {
   return map_range(C, [](auto &Entry) -> auto & { return Entry.second; });
 }
 
+template <typename SetTy> bool doSetsIntersect(const SetTy &A, const SetTy &B) {
+  for (const auto &Elt : A) {
+    if (B.contains(Elt))
+      return true;
+  }
+  return false;
+}
+
+template <class Ty>
+void setVectorUnion(SetVector<Ty> &S1, const SetVector<Ty> &S2) {
+  for (auto SI = S2.begin(), SE = S2.end(); SI != SE; ++SI)
+    S1.insert(*SI);
+}
+
----------------
arsenm wrote:

Is this reinventing utilities from ADT/SetOperations.h?

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


More information about the llvm-commits mailing list