[LLVMdev] Calling Conventions, function prologs and epilogs.

Anton Korobeynikov anton at korobeynikov.info
Thu Apr 9 08:34:12 PDT 2009


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.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University




More information about the llvm-dev mailing list