[PATCH] D137435: [InstSimplify] (~A & B) | ~(A | B) --> ~A with logical and

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 09:05:22 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2266
+  // The same is true of Logical And
+  if (match(X, m_c_LogicalAnd(
+                   m_CombineAnd(m_Value(NotA), m_NotForbidUndef(m_Value(A))),
----------------
m_c_LogicalAnd also matches m_c_And, no need for both.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2269
+                   m_Value(B))) &&
+      match(Y, m_Not(m_c_Or(m_Specific(A), m_Specific(B)))))
+    return NotA;
----------------
>From a quick try, it looks like this can also be LogicalOr?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137435/new/

https://reviews.llvm.org/D137435



More information about the llvm-commits mailing list