[llvm-commits] [llvm] r119947 - /llvm/trunk/lib/Target/X86/README.txt

Evan Cheng evan.cheng at apple.com
Mon Nov 29 14:57:32 PST 2010


Actually, this doesn't appear to be working on Darwin either. The issue is the call is turned into a fsin node and the "tailcall" property is apparently lost by the time legalizer expands it back into a call.  This needs to be fixed but I am not sure how.

Evan

On Nov 21, 2010, at 10:59 AM, Chris Lattner wrote:

> 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
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101129/ee939a6e/attachment.html>


More information about the llvm-commits mailing list