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>
Dale Johannesen
2009-Apr-09 18:19 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
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>
Aaron Gray
2009-Apr-09 18:32 UTC
[LLVMdev] Calling Conventions, function prologs and epilogs.
On Thu, Apr 9, 2009 at 7:19 PM, Dale Johannesen <dalej at apple.com> wrote:> > 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. >Yes, I see now. Thanks, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090409/e2679150/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
- [RFC][AArch64] Homogeneous Prolog and Epilog for Size Optimization