[PATCH] D45828: [PatternMatch] Stabilize the matching order of commutative matchers
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 19 14:54:34 PDT 2018
lebedev.ri added inline comments.
================
Comment at: include/llvm/IR/PatternMatch.h:495
+/// A commutative-friendly version of m_Specific().
+inline specificvalc_ty m_c_Specific(specificvalc_ty::ValTy *V) { return V; }
+
----------------
lebedev.ri wrote:
> craig.topper wrote:
> > This doesn't only fix commutative so I don't think the name should be tied to that.
> >
> > This was also not possible before, but would be with this new matcher.
> >
> > ```
> > match(m_And(m_Value(X), m_Or(m_Specific(X), m_Value(Y))
> > ```
> Yes, i agree.
> Any suggestions for a better name?
Would `m_Deferred()` sound better?
I think it would convey the idea that the actual value
is only acquired [to be checked] at the time of the `match()` itself.
Repository:
rL LLVM
https://reviews.llvm.org/D45828
More information about the llvm-commits
mailing list