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
This commit is contained in:
Chris Lattner 2002-05-23 17:11:38 +00:00
parent 89d46b0f09
commit c2b42b38f9

View 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;