implement or.ll:test20

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-05-06 00:58:50 +00:00
parent 056ea904a7
commit 828eeddb38

View File

@ -1872,6 +1872,13 @@ Instruction *InstCombiner::visitOr(BinaryOperator &I) {
A = 0;
}
if (match(Op0, m_And(m_Value(A), m_Value(B))))
if (A == Op1 || B == Op1) // (A & ?) | A --> A
return ReplaceInstUsesWith(I, Op1);
if (match(Op1, m_And(m_Value(A), m_Value(B))))
if (A == Op0 || B == Op0) // A | (A & ?) --> A
return ReplaceInstUsesWith(I, Op0);
if (match(Op1, m_Not(m_Value(B)))) { // Op0 | ~B
if (Op0 == B)
return ReplaceInstUsesWith(I,