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 | fd12a0b20b12b0199011fb3903aa1f8ca4b387f5 (patch) | |
tree | 316cbc3d5c50bf5c5c91b7ef02779bc339cfdfa7 /lib/Transforms | |
parent | 310d2eb202cf51dd03b4ef05893f6fd0203d7d52 (diff) | |
download | external_llvm-fd12a0b20b12b0199011fb3903aa1f8ca4b387f5.zip external_llvm-fd12a0b20b12b0199011fb3903aa1f8ca4b387f5.tar.gz external_llvm-fd12a0b20b12b0199011fb3903aa1f8ca4b387f5.tar.bz2 |
Adding i1 is always Xor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 74e6b6f..5199578 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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)) |