mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
Fix a faulty optimization on FP values
llvm-svn: 11801
This commit is contained in:
parent
b086ac893e
commit
fc15346b60
@ -441,7 +441,8 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
|
||||
Value *LHS = I.getOperand(0), *RHS = I.getOperand(1);
|
||||
|
||||
// X + 0 --> X
|
||||
if (RHS == Constant::getNullValue(I.getType()))
|
||||
if (!I.getType()->isFloatingPoint() && // -0 + +0 = +0, so it's not a noop
|
||||
RHS == Constant::getNullValue(I.getType()))
|
||||
return ReplaceInstUsesWith(I, LHS);
|
||||
|
||||
// X + X --> X << 1
|
||||
|
Loading…
Reference in New Issue
Block a user