[PATCH] D149879: [MachineFunction][DebugInfo][nfc] Introduce EntryValue variable kind

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 11:33:04 PDT 2023


fdeazeve created this revision.
fdeazeve added a reviewer: aprantl.
Herald added a subscriber: hiraditya.
Herald added a project: All.
fdeazeve requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

MachineFunction keeps a table of variables whose addresses never change
throughout the function. Today, the only kinds of locations it can
handle are stack slots.

However, we could expand this for variables whose address is derived
from the value a register had upon function entry. One case where this
happens is with variables alive across coroutine funclets: these can
be placed in a coroutine frame object whose pointer is placed in a
register that is an argument to coroutine funclets.

  define @foo(ptr %frame_ptr) {
    dbg.declare(%frame_ptr, !some_var,
                !DIExpression(EntryValue, <ptr_arithmetic>))

This is a patch in a series that aims to improve the debug information
generated by the CoroSplit pass in the context of `swiftasync`
arguments. Variables stored in the coroutine frame _must_ be described
the entry_value of the ABI-defined register containing a pointer to the
coroutine frame. Since these variables have a single location throughout
their lifetime, they are candidates for being stored in the
MachineFunction table.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149879

Files:
  llvm/include/llvm/CodeGen/MachineFunction.h
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/MIRPrinter.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/StackColoring.cpp
  llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149879.519581.patch
Type: text/x-patch
Size: 9947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230504/66314f47/attachment.bin>


More information about the llvm-commits mailing list