diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-23 17:11:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-23 17:11:38 +0000 |
commit | c2b42b38f9027f68b35f7ef7d4b1b5d2da38ab61 (patch) | |
tree | 1ce9f4cc54338c7a494157cd3eba6bfcd679219e /lib | |
parent | 89d46b0f095cf7f536c6ad40b4541b73d259445f (diff) | |
download | external_llvm-c2b42b38f9027f68b35f7ef7d4b1b5d2da38ab61.zip external_llvm-c2b42b38f9027f68b35f7ef7d4b1b5d2da38ab61.tar.gz external_llvm-c2b42b38f9027f68b35f7ef7d4b1b5d2da38ab61.tar.bz2 |
Fold add X, 0 for floating point types as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index b6727d5..6032ab9 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -124,8 +124,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator *I) { Value *LHS = I->getOperand(0), *RHS = I->getOperand(1); // Eliminate 'add int %X, 0' - if (I->getType()->isIntegral() && - RHS == Constant::getNullValue(I->getType())) { + if (RHS == Constant::getNullValue(I->getType())) { AddUsesToWorkList(I); // Add all modified instrs to worklist I->replaceAllUsesWith(LHS); return I; |