[llvm-commits] [llvm] r55807 - in /llvm/trunk: lib/Target/X86/X86CallingConv.td lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2007-08-13-SpillerReuse.ll test/CodeGen/X86/2008-02-22-ReMatBug.ll test/CodeGen/X86/coalescer-commute3.ll test/CodeGen/X86/combine-lds.ll test/CodeGen/X86/fastcc.ll

Duncan Sands baldrick at free.fr
Mon Sep 22 00:54:33 PDT 2008


> > Does this mean that "PerformTailCallOpt" changes the ABI?

Arnold already agreed that tailcall could use the new calling convention,
i.e. be the same as fastcc.

> First of all, the comment about "nested function not being supported  
> by fastcc" looks wrong.

It is correct.  The problem is that the tailcall logic reserves a
register (ECX; would be EAX in new fastcc) for its own use.  The
trampoline stuff wants that same register to do trampoline stuff
(it's the only spare register).  If the two calling conventions are
merged (i.e. tailcall cc dropped), there would be the problem of
detecting that tailcall and trampoline are fighting for the same
register, so an error can be issued.  I think the right solution is
to explicitly represent in the td that tailcall wants the register,
in much the same way as trampoline stuff does.  Something like this:

   CCIfTailCall<CCAssignToReg<[EAX]>>,

Ciao,

Duncan.

PS: There might be other incompatibilities between tailcall and
trampolines, but I can't say because I don't know what tailcall
does exactly.



More information about the llvm-commits mailing list