[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Feb 2 14:11:13 PST 2004


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.149 -> 1.150

---
Log message:

Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.


---
Diffs of the changes:  (+2 -1)

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.149 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.150
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.149	Wed Jan 14 00:06:08 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Feb  2 14:09:56 2004
@@ -512,7 +512,8 @@
       // Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression
       // is not used by anyone else...
       //
-      if (Op1I->getOpcode() == Instruction::Sub) {
+      if (Op1I->getOpcode() == Instruction::Sub &&
+          !Op1I->getType()->isFloatingPoint()) {
         // Swap the two operands of the subexpr...
         Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
         Op1I->setOperand(0, IIOp1);





More information about the llvm-commits mailing list