[PATCH] D49975: [InstSimplify] Fold another Select with And/Or pattern

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 05:27:57 PDT 2018


spatel added inline comments.


================
Comment at: lib/Analysis/InstructionSimplify.cpp:100
   CmpInst::Predicate Pred1, Pred2;
-  if (!match(
-          Cond,
-          m_c_BinOp(m_c_ICmp(Pred1, m_Specific(TrueVal), m_Specific(FalseVal)),
-                    m_c_ICmp(Pred2, m_Specific(TrueVal), m_Value()))) ||
+  Value *V, *Z;
+  if (!match(Cond, m_c_BinOp(m_c_ICmp(Pred1, m_Specific(TrueVal),
----------------
I think the logic is correct, but this is confusing variable naming because it doesn't match the code comments above. Just call these *X, *Y?


================
Comment at: lib/Analysis/InstructionSimplify.cpp:103
+                                      m_Specific(FalseVal)),
+                             m_c_ICmp(Pred2, m_Value(V), m_Value(Z)))) ||
       Pred1 != Pred2 || Pred1 != ExpectedPred)
----------------
This does not need to be a commutative matcher?


https://reviews.llvm.org/D49975





More information about the llvm-commits mailing list