diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-02-02 20:09:56 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-02-02 20:09:56 +0000 |
| commit | c2f0aa58dfff6182677f70d26ec85634ae045e3d (patch) | |
| tree | 6ad5eedc130945e16588c2f6c3dbf3f5fcbbe4d9 /llvm/lib | |
| parent | cacd30b9579310292761c39d8a818d8fbe0dc632 (diff) | |
| download | bcm5719-llvm-c2f0aa58dfff6182677f70d26ec85634ae045e3d.tar.gz bcm5719-llvm-c2f0aa58dfff6182677f70d26ec85634ae045e3d.zip | |
Disable (x - (y - z)) => (x + (z - y)) optimization for floating point.
llvm-svn: 11083
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index bc9558e8db1..8a089555b8d 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -512,7 +512,8 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) { // 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); |

