Fold add X, 0 for floating point types as well
authorChris Lattner <sabre@nondot.org>
Thu, 23 May 2002 17:11:38 +0000 (17:11 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 May 2002 17:11:38 +0000 (17:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2734 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index b6727d5f9e039ffea85a5a84206422292c705785..6032ab956eb674247e05c6f1031ddcfe62893e17 100644 (file)
@@ -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;