[llvm] [VPlan] Simplify vp.merge true, (or x, y), x -> vp.merge y, true, x (PR #135017)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 13:03:49 PDT 2025


================
@@ -136,11 +136,29 @@ template <typename LTy, typename RTy> struct match_combine_or {
   }
 };
 
+template <typename LTy, typename RTy> struct match_combine_and {
+  LTy L;
+  RTy R;
+
+  match_combine_and(const LTy &Left, const RTy &Right) : L(Left), R(Right) {}
+
+  template <typename ITy> bool match(ITy *V) const {
+    return L.match(V) && R.match(V);
+  }
+};
+
 template <typename LTy, typename RTy>
+/// Combine two pattern matchers matching L || R
----------------
lukel97 wrote:

Fixed, thanks

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


More information about the llvm-commits mailing list