summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
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
commitc7be519dc004a51cbb2db1ab8c450eec9d2305eb (patch)
treeb5d8a7e7c5630febce28147d3437444139530cef /llvm/test/Transforms
parenta0016db818aecc14486b93c8f1f72642cac4e5de (diff)
downloadbcm5719-llvm-c7be519dc004a51cbb2db1ab8c450eec9d2305eb.tar.gz
bcm5719-llvm-c7be519dc004a51cbb2db1ab8c450eec9d2305eb.zip
Preserve fast-math flags when folding (fsub x, (fneg y)) to (fadd x, y).
llvm-svn: 187462
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/fneg-ext.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fneg-ext.ll b/llvm/test/Transforms/InstCombine/fneg-ext.ll
index 49ad2325261..922d26a465b 100644
--- a/llvm/test/Transforms/InstCombine/fneg-ext.ll
+++ b/llvm/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
+}
OpenPOWER on IntegriCloud