[PATCH] D32665: [InstCombine] don't use DeMorgan's Law on integer constants

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 08:30:54 PDT 2017


spatel added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2441
+  // ~(Y & ~X) --> (X | ~Y)
+  if (match(&I, m_Not(m_c_And(m_Not(m_Value(X)), m_Value(Y))))) {
+    Value *NotY = Builder->CreateNot(Y, Y->getName() + ".not");
----------------
efriedma wrote:
> Do we need to check the number of uses for the inner operations?
Good point - I'll add some tests so we can see what that trade-off looks like.


https://reviews.llvm.org/D32665





More information about the llvm-commits mailing list