summaryrefslogtreecommitdiffstats
path: root/test/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
commite54aba5fa959a6196c1d50fe9c229836ec59039e (patch)
tree12672f1d11345566278f95672abf79ff5df201c5 /test/Transforms
parent194ae785e1f94619cbdcdcf2921caa6997277d32 (diff)
downloadexternal_llvm-e54aba5fa959a6196c1d50fe9c229836ec59039e.zip
external_llvm-e54aba5fa959a6196c1d50fe9c229836ec59039e.tar.gz
external_llvm-e54aba5fa959a6196c1d50fe9c229836ec59039e.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 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/fsub-fsub.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fsub-fsub.ll b/test/Transforms/InstCombine/fsub-fsub.ll
new file mode 100644
index 0000000..ab70479
--- /dev/null
+++ b/test/Transforms/InstCombine/fsub-fsub.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep fsub | count 2
+; PR4374
+
+define float @func(float %a, float %b) nounwind {
+ %tmp3 = fsub float %a, %b
+ %tmp4 = fsub float -0.000000e+00, %tmp3
+ ret float %tmp4
+}