projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
056ea90
)
implement or.ll:test20
author
Chris Lattner
<sabre@nondot.org>
Fri, 6 May 2005 00:58:50 +0000
(
00:58
+0000)
committer
Chris Lattner
<sabre@nondot.org>
Fri, 6 May 2005 00:58:50 +0000
(
00:58
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21709
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index fa615cfc5178361bb2027bd7519a2a6a534aa02f..7fed5aa8c697b349bd656ccbc855de1775a5edba 100644
(file)
--- 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,