[PATCH] D94870: [InstSimplify] Handle commutativity for 'and' and 'outer or' for (~A & B) | ~(A | B) --> ~A

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 16 10:33:17 PST 2021


lebedev.ri accepted this revision.
lebedev.ri added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2270
   // (B & ~A) | ~(B | A) --> ~A
-  if (match(Op0, m_And(m_Not(m_Value(A)), m_Value(B))) &&
+  if (match(Op0, m_c_And(m_CombineAnd(m_Value(NotA), m_Not(m_Value(A))), m_Value(B))) &&
       match(Op1, m_Not(m_c_Or(m_Specific(A), m_Specific(B)))))
----------------
Please clang-format


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:2279
+  // ~(B | A) | (B & ~A) --> ~A
+  if (match(Op1, m_c_And(m_CombineAnd(m_Value(NotA), m_Not(m_Value(A))), m_Value(B))) &&
+      match(Op0, m_Not(m_c_Or(m_Specific(A), m_Specific(B)))))
----------------
Please clang-format


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

https://reviews.llvm.org/D94870



More information about the llvm-commits mailing list