[llvm] [PatternMatchHelpers] Introduce m_Unless (NFC) (PR #212454)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 02:14:16 PDT 2026


================
@@ -208,7 +208,7 @@ template <typename Pred> struct Not {
 template <typename Pred> Not(const Pred &P) -> Not<Pred>;
 
 /// Match if the inner pattern does NOT match.
-template <typename Pred> inline Not<Pred> m_Unless(const Pred &P) {
----------------
artagnon wrote:

See line 49 of PatternMatch.h:

```cpp
using namespace llvm::PatternMatchHelpers;
```

The PatternMatchHelpers namespace can obviously not be nested within PatternMatch, because it's used by SCEV/VPlanPatternMatch as well, so the only "solution" is to never include PatternMatch.h within spaces that have an incompatible PatternMatch (eg. SDAG).

https://github.com/llvm/llvm-project/pull/212454


More information about the llvm-commits mailing list