[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
Mon May 1 10:16:32 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");
----------------
spatel wrote:
> 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.
I made a separate patch to answer this part since it exists independently of this change:
D32703 


https://reviews.llvm.org/D32665





More information about the llvm-commits mailing list