summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/fneg-ext.ll
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2013-07-30 23:53:17 +0000
committerOwen Anderson <resistor@mac.com>2013-07-30 23:53:17 +0000
commit605b3427a9423c1e291a9e9ab94fd7202ca864ae (patch)
tree75919c6202ae38d5fa9d39d591c6141d52915d7d /test/Transforms/InstCombine/fneg-ext.ll
parentb0bee810e7f980ccb4c0ee56aed948716a51d0ab (diff)
downloadllvm-605b3427a9423c1e291a9e9ab94fd7202ca864ae.tar.gz
llvm-605b3427a9423c1e291a9e9ab94fd7202ca864ae.tar.bz2
llvm-605b3427a9423c1e291a9e9ab94fd7202ca864ae.tar.xz
Preserve fast-math flags when folding (fsub x, (fneg y)) to (fadd x, y).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/fneg-ext.ll')
-rw-r--r--test/Transforms/InstCombine/fneg-ext.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fneg-ext.ll b/test/Transforms/InstCombine/fneg-ext.ll
index 49ad232526..922d26a465 100644
--- a/test/Transforms/InstCombine/fneg-ext.ll
+++ b/test/Transforms/InstCombine/fneg-ext.ll
@@ -10,3 +10,14 @@ define double @test1(float %a, double %b) nounwind readnone ssp uwtable {
%3 = fsub double %b, %2
ret double %3
}
+
+; CHECK: test2
+define double @test2(float %a, double %b) nounwind readnone ssp uwtable {
+; CHECK-NOT: fsub
+; CHECK: fpext
+; CHECK: fadd fast
+ %1 = fsub float -0.000000e+00, %a
+ %2 = fpext float %1 to double
+ %3 = fsub fast double %b, %2
+ ret double %3
+}