[PATCH] D45828: [PatternMatch] Stabilize the matching order of commutative matchers

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 02:04:44 PDT 2018


xbolva00 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:
> 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.
Yes, I vote for other name than "m_c_Specific" too.


Repository:
  rL LLVM

https://reviews.llvm.org/D45828





More information about the llvm-commits mailing list