[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 24 12:11:02 PST 2004
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.164 -> 1.165
---
Log message:
Fix a faulty optimization on FP values
---
Diffs of the changes: (+2 -1)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.164 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.165
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.164 Mon Feb 23 15:46:58 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Feb 24 12:10:14 2004
@@ -441,7 +441,8 @@
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
More information about the llvm-commits
mailing list