[PATCH] D73739: Exception support for basic block sections

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 12:58:05 PST 2020


rahmanl created this revision.
rahmanl added reviewers: majnemer, davidxl.
Herald added subscribers: llvm-commits, aheejin, hiraditya, sbc100.
Herald added a project: LLVM.

This is part of the Propeller framework to do post link code layout optimizations. Please see the RFC here: https://groups.google.com/forum/#!msg/llvm-dev/ef3mKzAdJ7U/1shV64BYBAAJ and the detailed RFC doc here: https://github.com/google/llvm-propeller/blob/plo-dev/Propeller_RFC.pdf

This patch provides exception support for basic block sections by splitting the call-site table into call-site ranges corresponding to different basic block sections. Still all landing pads must reside in the same basic block section (which is guaranteed by the the core basic block section patch D73674 <https://reviews.llvm.org/D73674> (ExceptionSection) ). Each call-site table will refer to the landing pad fragment by explicitly specifying @LPstart (which is omitted in the normal non-basic-block section case). All these call-site tables will share their action and type tables.

The C++ ABI somehow assumes that no landing pads point directly to LPStart (which works in the normal case since the function begin is never a landing pad), and uses LP.offset = 0 to specify no landing pad. In the case of basic block section where one section contains all the landing pads, the landing pad offset relative to LPStart could actually be zero. Thus, we avoid zero-offset landing pads by inserting a **nop** operation as the first non-CFI instruction in the exception section.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73739

Files:
  llvm/include/llvm/CodeGen/AsmPrinter.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp
  llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
  llvm/lib/CodeGen/AsmPrinter/EHStreamer.h
  llvm/lib/CodeGen/AsmPrinter/WasmException.cpp
  llvm/lib/CodeGen/AsmPrinter/WasmException.h
  llvm/test/CodeGen/X86/gcc_except_table_basicblock-sections.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73739.241517.patch
Type: text/x-patch
Size: 28971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200130/e4b607eb/attachment.bin>


More information about the llvm-commits mailing list