summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-23 17:11:38 +0000
committerChris Lattner <sabre@nondot.org>2002-05-23 17:11:38 +0000
commit9c2765d4aa8c4acba87061c65f4de91ffc97f220 (patch)
tree363bef34badc718d696eae8ce454d34a967060d5 /llvm/lib
parent5cd012d58c5b3e309f1f008120d825a22f614fff (diff)
downloadbcm5719-llvm-9c2765d4aa8c4acba87061c65f4de91ffc97f220.tar.gz
bcm5719-llvm-9c2765d4aa8c4acba87061c65f4de91ffc97f220.zip
Fold add X, 0 for floating point types as well
llvm-svn: 2734
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index b6727d5f9e0..6032ab956eb 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud