[LLVMdev] Calling Conventions, function prologs and epilogs.

Dale Johannesen dalej at apple.com
Thu Apr 9 11:19:16 PDT 2009


On Apr 9, 2009, at 11:11 AMPDT, Aaron Gray wrote:

> On Thu, Apr 9, 2009 at 4:34 PM, Anton Korobeynikov <anton at korobeynikov.info 
> > wrote:
> Hello, Aaron
>
> > How/where are function prologs and epilogs generated, is it  
> bespoke C++ code
> > or TableGen generated ?
> >
> > If someone could point me in the right direction please.
> Calling convention is really-really far from prologue/epilogue  
> emission :) So:
>
> 1. Calling conventions
> Partly tablegen / partly C++ code. Look for
> CodeGen/SelectionDAG/CallingConvLower.cpp,
> Target/X86/X86CallingConv.td and around. Usually this code is run
> during different phases of sdag lowering.
>
> 2. Prologue / epilogue.
> Pure C++ code. Look into CodeGen/PrologEpilogInserter.cpp (quite
> obviously, right?) with bunch of target-specialized hooks, for
> example, ones located in Target/X86/X86RegisterInfo.cpp. Information
> about this is needed on different stages, some - even before regalloc,
> some - in the late end of the codegen.
>
> Hope this will help.
> Yes, great. One other question. AFAICS this does not allow  
> specialization say for a new Windows platform (Not MinGW or Cygwin) / 
> Target to produce different code from X86 Linux.

You would add a new Subtarget to do this.  That will affect a fair  
amount of code but it should all be in Target/X86.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090409/ce7663e6/attachment.html>


More information about the llvm-dev mailing list