diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-05-06 00:58:50 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-05-06 00:58:50 +0000 |
| commit | dd1e562ec3a49b2b1f9ccfe59ce3b681be6ab729 (patch) | |
| tree | c08577b085d2ac37cef3e21102d59e3546ddd1a6 /llvm/lib | |
| parent | ce8dd82d66288f1fc93547add6f9162d1cb8c475 (diff) | |
| download | bcm5719-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.cpp | 7 |
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, |

