mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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:
parent
89d46b0f09
commit
c2b42b38f9
@ -124,8 +124,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator *I) {
|
|||||||
Value *LHS = I->getOperand(0), *RHS = I->getOperand(1);
|
Value *LHS = I->getOperand(0), *RHS = I->getOperand(1);
|
||||||
|
|
||||||
// Eliminate 'add int %X, 0'
|
// Eliminate 'add int %X, 0'
|
||||||
if (I->getType()->isIntegral() &&
|
if (RHS == Constant::getNullValue(I->getType())) {
|
||||||
RHS == Constant::getNullValue(I->getType())) {
|
|
||||||
AddUsesToWorkList(I); // Add all modified instrs to worklist
|
AddUsesToWorkList(I); // Add all modified instrs to worklist
|
||||||
I->replaceAllUsesWith(LHS);
|
I->replaceAllUsesWith(LHS);
|
||||||
return I;
|
return I;
|
||||||
|
Loading…
Reference in New Issue
Block a user