[PATCH] D114339: [InstCombine] simplify (~A | B) ^ A --> ~( A & B)

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 22 01:14:07 PST 2021


foad added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:3619
+  // (~A | B) ^ A --> ~(A & B) -- There are 4 commuted variants.
+  if (match(&I, m_c_Xor(m_c_Or(m_Not(m_Value(A)), m_Value(B)), m_Deferred(A))))
+    return BinaryOperator::CreateNot(Builder.CreateAnd(A, B));
----------------
This probably needs some `m_OneUse`s (but I'm not sure how you decide exactly where to put them).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114339



More information about the llvm-commits mailing list