summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fp-stack-retcopy.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-16 05:56:59 +0000
committerChris Lattner <sabre@nondot.org>2008-01-16 05:56:59 +0000
commit8f7cec859e8960a361165a323a3e5f6d44f012ba (patch)
treeed4d31e596ef0905d14d06e4464d0286c2cd1501 /llvm/test/CodeGen/X86/fp-stack-retcopy.ll
parentea001f1db7c78d469a0e6adec539d7e1b0638e65 (diff)
downloadbcm5719-llvm-8f7cec859e8960a361165a323a3e5f6d44f012ba.tar.gz
bcm5719-llvm-8f7cec859e8960a361165a323a3e5f6d44f012ba.zip
My previous commit had an incomplete message, it should have been:
make the 'fp return in ST(0)' optimization smart enough to look through token factor nodes. THis allows us to compile testcases like CodeGen/X86/fp-stack-retcopy.ll into: _carg: subl $12, %esp call L_foo$stub fstpl (%esp) fldl (%esp) addl $12, %esp ret instead of: _carg: subl $28, %esp call L_foo$stub fstpl 16(%esp) movsd 16(%esp), %xmm0 movsd %xmm0, 8(%esp) fldl 8(%esp) addl $28, %esp ret Still not optimal, but much better and this is a trivial patch. Fixing the rest requires invasive surgery that is is not llvm 2.2 material. llvm-svn: 46054
Diffstat (limited to 'llvm/test/CodeGen/X86/fp-stack-retcopy.ll')
-rw-r--r--llvm/test/CodeGen/X86/fp-stack-retcopy.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp-stack-retcopy.ll b/llvm/test/CodeGen/X86/fp-stack-retcopy.ll
new file mode 100644
index 00000000000..997f8df20fe
--- /dev/null
+++ b/llvm/test/CodeGen/X86/fp-stack-retcopy.ll
@@ -0,0 +1,12 @@
+; This should not copy the result of foo into an xmm register.
+; RUN: llvm-as < %s | llc -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin9 | not grep xmm
+; rdar://5689903
+
+declare double @foo()
+
+define double @carg({ double, double }* byval %z) nounwind {
+entry:
+ %tmp5 = tail call double @foo() nounwind ; <double> [#uses=1]
+ ret double %tmp5
+}
+
OpenPOWER on IntegriCloud