diff options
| author | Dan Gohman <gohman@apple.com> | 2009-06-12 19:23:25 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-06-12 19:23:25 +0000 |
| commit | c48b249e98fcef47957a354699dc2e191077393c (patch) | |
| tree | 12672f1d11345566278f95672abf79ff5df201c5 /lib/Transforms | |
| parent | c0273dad1f2c8226d1c55cd1429794d6415e8adc (diff) | |
| download | external_llvm-c48b249e98fcef47957a354699dc2e191077393c.zip external_llvm-c48b249e98fcef47957a354699dc2e191077393c.tar.gz external_llvm-c48b249e98fcef47957a354699dc2e191077393c.tar.bz2 | |
Don't do (x - (y - z)) --> (x + (z - y)) on floating-point types, because
it may round differently. This fixes PR4374.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
| -rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 03a7317..5465e4a 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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; |
