projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e4ca61
)
Fix a faulty optimization on FP values
author
Chris Lattner
<sabre@nondot.org>
Tue, 24 Feb 2004 18:10:14 +0000
(18:10 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Tue, 24 Feb 2004 18:10:14 +0000
(18:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11801
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index fb7dc9849235706ceacbca8d9186c6d8bd891d68..322112a942ef06fbbf1a48fbb3c7c7653b3bfe54 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-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