Aaron Gray
2009-Apr-09 14:58 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
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. Many thanks in advance, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090409/fb3336e4/attachment.html>
Luke Dalessandro
2009-Apr-09 15:10 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
Aaron Gray wrote:> How/where are function prologs and epilogs generated, is it bespoke C++ > code or TableGen generated ?Each target seems to define a RegisterInfo::emitPrologue and RegisterInfo::emitEpilog function that is called by the lib/CodeGen/PrologueEpilogueInserter.cpp transformation. Hope this helps, Luke> > If someone could point me in the right direction please. > > Many thanks in advance, > > Aaron > > > > ------------------------------------------------------------------------ > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Anton Korobeynikov
2009-Apr-09 15:34 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
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
Aaron Gray
2009-Apr-09 18:11 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
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. Thanks, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090409/52ddce4f/attachment.html>
Maybe Matching Threads
- [LLVMdev] Calling Conventions, function prologs and epilogs.
- [LLVMdev] Calling Conventions, function prologs and epilogs.
- [LLVMdev] Calling Conventions, function prologs and epilogs.
- [RFC][AArch64] Homogeneous Prolog and Epilog for Size Optimization
- [LLVMdev] main, prologue & call