[PATCH] D12546: [WinEH] Emit prologues and epilogues for funclets

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 16:57:40 PDT 2015


rnk created this revision.
rnk added a reviewer: majnemer.
rnk added a subscriber: llvm-commits.

32-bit funclets have short prologues that allocate enough stack for the
largest call in the whole function. The runtime saves CSRs for the
funclet. It doesn't restore CSRs after we finally transfer control back
to the parent funciton via a CATCHRET, but that's a separate issue.
32-bit funclets also have to adjust the incoming EBP value, which is
what llvm.x86.seh.recoverframe does in the old model.

64-bit funclets need to spill CSRs as normal. For simplicity, this just
spills the same set of CSRs as the parent function, rather than trying
to compute different CSR sets for the parent function and each funclet.
64-bit funclets also allocate enough stack space for the largest
outgoing call frame, like 32-bit.

http://reviews.llvm.org/D12546

Files:
  include/llvm/CodeGen/WinEHFuncInfo.h
  lib/CodeGen/AsmPrinter/WinException.cpp
  lib/CodeGen/PrologEpilogInserter.cpp
  lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86FrameLowering.h
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86MCInstLower.cpp
  lib/Target/X86/X86WinEHState.cpp
  test/CodeGen/X86/win-catchpad-csrs.ll
  test/CodeGen/X86/win-catchpad.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12546.33758.patch
Type: text/x-patch
Size: 29214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150901/edbfe3ea/attachment.bin>


More information about the llvm-commits mailing list