mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-21 03:37:47 +00:00
Fix a faulty optimization on FP values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6e4ca61438
commit
d38f208cd9
@ -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…
x
Reference in New Issue
Block a user