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:
parent
2cf3917aae
commit
9dde5c9df7
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user