[llvm-commits] PATCH: Tailcallopt x86 byval argument handling

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Mon Apr 7 15:17:11 PDT 2008

Hi Evan (and everyone else who wants to bash this patch :),

this patch corrects handling of byval arguments for tailcall optimized
x86-64 (and x86) calls so that they work (... at least for my test

Should fix the following problems:

Problem 1: when i introduced the optimized handling of arguments for
tail called functions (not always moving them to a spill slot -
actually moving to the destination of the arg if the call were to be a
normal function call - before storing them at their 'tailcall'
position but using virtual registers) i did not handle byval arguments

Problem 2: on x86-64 after the arguments of the tail called function
are moved to their registers (which include ESI/RSI etc), tail call
optimization performs byval lowering which causes xSI,xDI, xCX
registers to be overwritten. this is handled in this patch by moving
the arguments to virtual registers first and after the byval lowering
the arguments are moved from those virtual registers back to

Okay to commit?

regards arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x86-byval.patch
Type: text/x-patch
Size: 12730 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080408/40d4ba89/attachment.bin>

More information about the llvm-commits mailing list