summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitdd1e562ec3a49b2b1f9ccfe59ce3b681be6ab729 (patch)
treec08577b085d2ac37cef3e21102d59e3546ddd1a6 /llvm/lib
parentce8dd82d66288f1fc93547add6f9162d1cb8c475 (diff)
downloadbcm5719-llvm-dd1e562ec3a49b2b1f9ccfe59ce3b681be6ab729.tar.gz
bcm5719-llvm-dd1e562ec3a49b2b1f9ccfe59ce3b681be6ab729.zip
implement or.ll:test20
llvm-svn: 21709
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index fa615cfc517..7fed5aa8c69 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud