diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-05-31 17:10:28 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-05-31 17:10:28 +0000 |
| commit | df9242a83354dee4078733d48693099b9299f68a (patch) | |
| tree | a325e947fce37c755c336161c0a19309aac1f6de /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | cd92aebd1f2203d97a6d4d34daac5080a690b133 (diff) | |
| download | bcm5719-llvm-df9242a83354dee4078733d48693099b9299f68a.tar.gz bcm5719-llvm-df9242a83354dee4078733d48693099b9299f68a.zip | |
Adding i1 is always Xor.
llvm-svn: 51816
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 74e6b6f6b06..5199578b1f8 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2551,6 +2551,9 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) { bool Changed = SimplifyCommutative(I); Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); + if (I.getType() == Type::Int1Ty) + return BinaryOperator::CreateXor(LHS, RHS); + if (Constant *RHSC = dyn_cast<Constant>(RHS)) { // X + undef -> undef if (isa<UndefValue>(RHS)) |

