Allow epilogue_begin to be emitted when generating DWARF
authorAriel Burton <Ariel.Burton@ibm.com>
Fri, 9 Dec 2022 20:04:27 +0000 (20:04 +0000)
committerKai Nacke <kai.peter.nacke@ibm.com>
Fri, 9 Dec 2022 20:17:37 +0000 (20:17 +0000)
commit6b2829dd877292c78158e37901f9e4ca52249c24
tree9340230a5189aea8dd09d734f95424d8f1e1b147
parent413995938d521032ba30c62dee738a2db7d1f1e8
Allow epilogue_begin to be emitted when generating DWARF

We identify epilogue code by looking for instructions tagged
with FrameDestroy.

A function may have more than one epilogue, e.g., because of early
returns or code duplicated during optimization. We need only track
the current block, and emit epilogie_begin at most once per block.

We reduce the number of entries in the line table by combining
epilogue_begin with other flags instead of emitting a separate
entry just for epilogue_begin.

Reviewed By: dblaikie, aprantl

Differential Revision: https://reviews.llvm.org/D133376
12 files changed:
llvm/include/llvm/CodeGen/DebugHandlerBase.h
llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/test/CodeGen/AMDGPU/no-source-locations-in-prologue.ll
llvm/test/CodeGen/X86/dbg-line-0-no-discriminator.ll
llvm/test/DebugInfo/AArch64/line-header.ll
llvm/test/DebugInfo/Generic/extended-loc-directive.ll
llvm/test/DebugInfo/Generic/multiline.ll
llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
llvm/test/DebugInfo/X86/basic-block-sections_1.ll
llvm/test/DebugInfo/X86/multiple-epilogue.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll