From 9c2765d4aa8c4acba87061c65f4de91ffc97f220 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 May 2002 17:11:38 +0000 Subject: Fold add X, 0 for floating point types as well llvm-svn: 2734 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp') 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; -- cgit v1.2.3