[LLVMdev] RFC: Tail call optimization X86

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Fri Oct 5 10:56:04 PDT 2007


On 5 Oct 2007, at 19:41, Evan Cheng wrote:
>
> On Oct 5, 2007, at 2:42 AM, Arnold Schwaighofer wrote:
>
>> Hi Evan,
>> I incoporated the changes you request but to the following i have got
>> a question:
>>
>>> Also, moving the option
>>> there will allow us to change fastcc ABI (callee popping arguments)
>>> only when this option is on. See Chris' email:
>>
>> I am not to sure on that. because that would make modules compiled
>> with the flag on incompatible with ones compiled without the flag off
>> as stack behaviour would mismatch.
>> It would be no problem to make the behaviour dependent on the -tail-
>> call-opt flag. i am not sure that this is a good idea?
>
> In theory, any function can be marked fastcc. But llvm-gcc c / c++
> frontend does *not* mark any external functions fastcc. Also, the
> optimizer only changes the calling convention of internal functions
> to fastcc.
well i hope llvm-gcc won't stay the only front-end (hoping to see some
functional languages like ocaml ;)

> We can set a policy of treating fastcc external functions
> as c functions. Then there is no chance of introducing ABI
> incompatibility.
this means limiting tail call opt to protected/invisible functions  
within a module?
a little limiting i think.

but i think if it is documented that there will be a incompatibility  
between
modules compiled with tailcallopt on/off that is okay?
and this would only happen if someone other than llvm-gcc used llvm  
as a backend
anyway.

so i will make tailcallopt toggle the stack adjusting behaviour. with  
llvm-gcc this won't be a problem
and if someone other using llvm as a backend runs in to a problem  
than there is the documentation
and the maillist that will help.

is that okay?

regards arnold



More information about the llvm-dev mailing list