apparently tailcalls are better on darwin/x86-64 than on linux?

llvm-svn: 119947
This commit is contained in:
Chris Lattner 2010-11-21 18:59:20 +00:00
parent a369f8dc3a
commit 5d2262dc76
1 changed files with 18 additions and 0 deletions

View File

@ -895,6 +895,24 @@ compare:
//===---------------------------------------------------------------------===//
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