[llvm] [PatternMatch] Use `m_SpecificCmp` matchers. NFC. (PR #100878)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 27 11:46:35 PDT 2024


================
@@ -110,10 +110,11 @@ static Value *foldSelectWithBinaryOp(Value *Cond, Value *TrueVal,
   // -->
   // %TV
   Value *X, *Y;
-  if (!match(Cond, m_c_BinOp(m_c_ICmp(Pred1, m_Specific(TrueVal),
-                                      m_Specific(FalseVal)),
-                             m_ICmp(Pred2, m_Value(X), m_Value(Y)))) ||
-      Pred1 != Pred2 || Pred1 != ExpectedPred)
+  if (!match(
+          Cond,
+          m_c_BinOp(m_c_ICmp(Pred1, m_Specific(TrueVal), m_Specific(FalseVal)),
----------------
nikic wrote:

Shouldn't this be?
```suggestion
          m_c_BinOp(m_c_SpecificICmp(ExpectedPred, m_Specific(TrueVal), m_Specific(FalseVal)),
```

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


More information about the llvm-commits mailing list