[LLVMdev] RFC: Tail call optimization X86

Chris Lattner sabre at nondot.org
Tue Sep 25 17:26:25 PDT 2007


On Tue, 25 Sep 2007, Evan Cheng wrote:
>> the stack adjustment only fastcc was not one of them. Now that fastcc
>> can cause tail call optimization i had to change the convention from
>> caller pops arguments to callee pops arguments in order to allow tail
>> call optimization in a general way.
>
> Hmmm. Ok. So this is due to X86CallingConv.td changes? Unfortunately
> that's not controlled by options. Ok then.

Sure it can be, you can set up custom predicates, for example the 
X86CallingConv.td file has:

class CCIfSubtarget<string F, CCAction A>
  : CCIf<!strconcat("State.getTarget().getSubtarget<X86Subtarget>().", F), A>;

It would be straight-forward to have a CCIf defined to check some command 
line argument.  I think enabling this as llcbeta for a few nights makes 
sense before turning it on by default.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list