[PATCH] Added InstCombine Transform for ((B | C) & A) | B -> B | (A & C)
David Majnemer
david.majnemer at gmail.com
Tue Aug 12 23:08:56 PDT 2014
================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2128-2129
@@ +2127,4 @@
+ // ((B | C) & A) | B -> B | (A & C)
+ if (match(Op0, m_And(m_Or(m_Value(B), m_Value(C)), m_Value(A))))
+ if (Op1 == B)
+ return BinaryOperator::CreateOr(B, Builder->CreateAnd(A, C));
----------------
Hrm, maybe this could be simplified further:
if (match(Op0, m_And(m_Or(m_Specific(Op1), m_Value(C)), m_Value(A))))
return BinaryOperator::CreateOr(Op1, Builder->CreateAnd(A, C));
http://reviews.llvm.org/D4865
More information about the llvm-commits
mailing list