[PATCH] D79978: Call Frame Information (CFI) Handling for Basic Block Sections

Sriraman Tallam via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 18:31:16 PDT 2020


tmsriram created this revision.
tmsriram added reviewers: dblaikie, davidxl.
Herald added subscribers: hiraditya, aprantl.
Herald added a project: LLVM.
tmsriram added a parent revision: D78851: Debug Info Support for Basic Block Sections.

Presenting this for review on behalf of @amharc  who is the original author of this patch.  This patch handles CFI with basic block sections, which unlike DebugInfo does not support ranges.   The DWARF standard explicitly requires emitting separate CFI Frame Descriptor Entries for each contiguous fragment of a function. Thus, the CFI information for all callee-saved registers (possibly including the frame pointer, if necessary) have to be emitted along with redefining the Call Frame Address (CFA), viz. where the current frame starts.

To keep the .eh_frame bloats minimal, we have implemented de-duplication of common CFI instructions to the CFI Common Information Entry. We only de-duplicate CFI instructions with offset 0 from the beginning of the CFI frame, i.e. those that describe the CFI state before entering the frame.

Having support for non-contiguous ranges in CFI would significantly minimize the size overheads and complexity of supporting basic block sections which we will leave for future work.


https://reviews.llvm.org/D79978

Files:
  llvm/include/llvm/CodeGen/TargetFrameLowering.h
  llvm/include/llvm/MC/MCDwarf.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfException.h
  llvm/lib/CodeGen/CFIInstrInserter.cpp
  llvm/lib/MC/MCDwarf.cpp
  llvm/lib/Target/AArch64/AArch64FrameLowering.h
  llvm/lib/Target/X86/X86FrameLowering.cpp
  llvm/lib/Target/X86/X86FrameLowering.h
  llvm/test/DebugInfo/X86/basicblock-sections-cfi.ll
  llvm/test/DebugInfo/X86/basicblock-sections-cfiinstr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79978.264135.patch
Type: text/x-patch
Size: 32633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200515/fde5d868/attachment.bin>


More information about the llvm-commits mailing list