summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-06-12 19:23:25 +0000
committerDan Gohman <gohman@apple.com>2009-06-12 19:23:25 +0000
commit9377b086f5481ed2bd0232b33491e51c565b6758 (patch)
tree041baf5f944b1edbed6991afee16bdd4d2df1c02 /llvm/lib/Transforms
parentdc41eb18e9c926750174526c46710ebfbee9c4f3 (diff)
downloadbcm5719-llvm-9377b086f5481ed2bd0232b33491e51c565b6758.tar.gz
bcm5719-llvm-9377b086f5481ed2bd0232b33491e51c565b6758.zip
Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
it may round differently. This fixes PR4374. llvm-svn: 73243
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 03a7317138a..5465e4a8846 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2608,21 +2608,6 @@ Instruction *InstCombiner::visitFSub(BinaryOperator &I) {
else if (Op1I->getOperand(1) == Op0) // X-(Y+X) == -Y
return BinaryOperator::CreateFNeg(Op1I->getOperand(0), I.getName());
}
-
- if (Op1I->hasOneUse()) {
- // Replace (x - (y - z)) with (x + (z - y)) if the (y - z) subexpression
- // is not used by anyone else...
- //
- if (Op1I->getOpcode() == Instruction::FSub) {
- // Swap the two operands of the subexpr...
- Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
- Op1I->setOperand(0, IIOp1);
- Op1I->setOperand(1, IIOp0);
-
- // Create the new top level fadd instruction...
- return BinaryOperator::CreateFAdd(Op0, Op1);
- }
- }
}
return 0;
OpenPOWER on IntegriCloud