1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00

Fold add X, 0 for floating point types as well

llvm-svn: 2734
This commit is contained in:
Chris Lattner 2002-05-23 17:11:38 +00:00
parent 2cf3917aae
commit 9dde5c9df7

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;