[PATCH] [InstCombineAddSub] Transformation for the expression (X | Y) - X --> (~X & Y)

David Majnemer david.majnemer at gmail.com
Sun Oct 26 14:34:46 PDT 2014


Actually, I think this needs a small tweak.

================
Comment at: lib/Transforms/InstCombine/InstCombineAddSub.cpp:1643-1648
@@ -1633,8 +1642,8 @@
 
     // (X - (X & Y))   -->   (X & ~Y)
     //
     if (match(Op1, m_And(m_Value(Y), m_Specific(Op0))) ||
         match(Op1, m_And(m_Specific(Op0), m_Value(Y))))
       return BinaryOperator::CreateAnd(Op0,
                                   Builder->CreateNot(Y, Y->getName() + ".not"));
 
----------------
Please move your change so it is near this pattern.

http://reviews.llvm.org/D5791






More information about the llvm-commits mailing list