[PATCH] D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 27 23:13:14 PDT 2019


lebedev.ri requested changes to this revision.
lebedev.ri added a comment.
This revision now requires changes to proceed.

Looks good in general but i have reservations about matchers.



================
Comment at: llvm/include/llvm/IR/PatternMatch.h:561-563
+/// Match an instruction of type T, capturing it if we match.
+/// For example m_isa<WithOverflowInst>(Y)
+template <typename T> inline bind_ty<T> m_isa(T *&I) { return I; }
----------------
I don't like this one.
Can we change it to be a two-step process - just make `m_isa<>()` a predicate,
if `isa<>()` matches, then it should apply inner matcher, if any.
And said inner matcher can be `m_Value()`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69245/new/

https://reviews.llvm.org/D69245





More information about the llvm-commits mailing list