[PATCH] D141917: WIP: Unwindabort: Implement CodeGen for DWARF-style exception handling.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 03:53:46 PST 2023


jyknight created this revision.
Herald added subscribers: llvm-commits, pengfei, sunfish, hiraditya, kristof.beyls, dschuff.
Herald added projects: LLVM, All.
jyknight requested review of this revision.
Herald added a subscriber: aheejin.

This change causes 'call unwindabort' to emit EH_LABELs and add them
to the list of EH regions, in both SelectionDAG and GlobalISel.

It also adjusts the DWARF "resume" lowering to lower "resume
unwindabort" to "call unwindabort" appropriately.

The actual LSDA callsite table emission did not require any changes:
it already worked as desired. Test-cases were added, however.

This does not yet implement support for the other varieties of
exception-handling supported by LLVM:

- Windows funclets
- WebAssembly
- setjmp/longjmp

TODO: currently basic-block-sections are broken, as they have a
pre-existing flaw: they emit invalid unwind tables, where the callsite
table size is larger than it should be. The assumption in the initial
commit was that this was a harmless lie: that the unwinder would never
notice the garbage after the callsites, because the prior entries
would cover the whole function. That was not _necessarily_ the case
before, but is definitely not the case now.

Depends on D141916 <https://reviews.llvm.org/D141916>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141917

Files:
  llvm/include/llvm/CodeGen/WinEHFuncInfo.h
  llvm/lib/CodeGen/Analysis.cpp
  llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
  llvm/lib/CodeGen/DwarfEHPrepare.cpp
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
  llvm/lib/CodeGen/WinEHPrepare.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
  llvm/test/CodeGen/AArch64/call-unwindabort-codegen.ll
  llvm/test/CodeGen/AArch64/unwindabort-inline-asm-codegen.ll
  llvm/test/CodeGen/X86/call-unwindabort-codegen.ll
  llvm/test/CodeGen/X86/eh-callsites.ll
  llvm/test/CodeGen/X86/indirect-branch-tracking-eh2.ll
  llvm/test/CodeGen/X86/unwind-inline-asm-codegen.ll
  llvm/test/CodeGen/X86/unwindabort-inline-asm-codegen.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141917.489760.patch
Type: text/x-patch
Size: 35277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230117/9fd26818/attachment.bin>


More information about the llvm-commits mailing list