summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2013-07-26 21:40:29 +0000
committerOwen Anderson <resistor@mac.com>2013-07-26 21:40:29 +0000
commit0c326f07ca713fa00d0dcba8ec9b61e91298f690 (patch)
tree7799e51b91aa712aa13e7cb0a34e2730ad69dec1 /test
parentd063a326b2567c3ca759f069e7680979036b9d5e (diff)
downloadllvm-0c326f07ca713fa00d0dcba8ec9b61e91298f690.tar.gz
llvm-0c326f07ca713fa00d0dcba8ec9b61e91298f690.tar.bz2
llvm-0c326f07ca713fa00d0dcba8ec9b61e91298f690.tar.xz
When InstCombine tries to fold away (fsub x, (fneg y)) into (fadd x, y), it is
also worthwhile for it to look through FP extensions and truncations, whose application commutes with fneg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/InstCombine/fneg-ext.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/fneg-ext.ll b/test/Transforms/InstCombine/fneg-ext.ll
new file mode 100644
index 0000000000..49ad232526
--- /dev/null
+++ b/test/Transforms/InstCombine/fneg-ext.ll
@@ -0,0 +1,12 @@
+; RUN: opt -instcombine -S < %s | FileCheck %s
+
+; CHECK: test1
+define double @test1(float %a, double %b) nounwind readnone ssp uwtable {
+; CHECK-NOT: fsub
+; CHECK: fpext
+; CHECK: fadd
+ %1 = fsub float -0.000000e+00, %a
+ %2 = fpext float %1 to double
+ %3 = fsub double %b, %2
+ ret double %3
+}