From c2b42b38f9027f68b35f7ef7d4b1b5d2da38ab61 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 May 2002 17:11:38 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/InstructionCombining.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index b6727d5f9e0..6032ab956eb 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; -- 2.34.1