[llvm] [SDPatternMatch] Add m_CondCode, m_NoneOf, and some SExt improvements (PR #90762)
Min-Yih Hsu via llvm-commits
llvm-commits at lists.llvm.org
Wed May 1 16:40:40 PDT 2024
================
@@ -358,6 +358,23 @@ struct Or<Pred, Preds...> : Or<Preds...> {
}
};
+template <typename Pred> struct Not {
+ Pred P;
+
+ explicit Not(const Pred &P) : P(P) {}
+
+ template <typename MatchContext>
+ bool match(const MatchContext &Ctx, SDValue N) {
+ return !P.match(Ctx, N);
+ }
+};
+// Explicit deduction guide.
+template <typename Pred> Not(const Pred &P) -> Not<Pred>;
+
+template <typename Pred> inline Not<Pred> m_IsNot(const Pred &P) {
----------------
mshockwave wrote:
That would indeed be more consistent. It's updated now.
https://github.com/llvm/llvm-project/pull/90762
More information about the llvm-commits
mailing list