[llvm-commits] [llvm] r119947 - /llvm/trunk/lib/Target/X86/README.txt
Chris Lattner
sabre at nondot.org
Sun Nov 21 10:59:21 PST 2010
Author: lattner
Date: Sun Nov 21 12:59:20 2010
New Revision: 119947
URL: http://llvm.org/viewvc/llvm-project?rev=119947&view=rev
Log:
apparently tailcalls are better on darwin/x86-64 than on linux?
Modified:
llvm/trunk/lib/Target/X86/README.txt
Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=119947&r1=119946&r2=119947&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Sun Nov 21 12:59:20 2010
@@ -895,6 +895,24 @@
//===---------------------------------------------------------------------===//
+Linux is missing some basic tail call support:
+
+#include <math.h>
+double foo(double a) { return sin(a); }
+
+This compiles into this on x86-64 Linux (but not darwin):
+foo:
+ subq $8, %rsp
+ call sin
+ addq $8, %rsp
+ ret
+vs:
+
+foo:
+ jmp sin
+
+//===---------------------------------------------------------------------===//
+
Tail call optimization improvements: Tail call optimization currently
pushes all arguments on the top of the stack (their normal place for
non-tail call optimized calls) that source from the callers arguments
More information about the llvm-commits
mailing list