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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 10:42:50 PDT 2018


craig.topper 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; }
+
----------------
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))
```


Repository:
  rL LLVM

https://reviews.llvm.org/D45828





More information about the llvm-commits mailing list