aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-06 00:58:50 +0000
committerChris Lattner <sabre@nondot.org>2005-05-06 00:58:50 +0000
commit828eeddb38594ec0756aaa1be992796883c4ac2a (patch)
treeaded0f30164f8ad4c9c3297d612657f0cbdaafe2 /lib
parent056ea904a783c3f51cf26c0b3a3d1f690a8892ef (diff)
implement or.ll:test20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index fa615cfc51..7fed5aa8c6 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -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,