[PATCH] D88175: [DebugInfo] Add new metadata, DIArgList, for referencing a list of SSA values inside a debug variable intrinsic

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 11:40:26 PDT 2020


StephenTozer created this revision.
StephenTozer added reviewers: aprantl, djtodoro, vsk, dblaikie, probinson.
StephenTozer added a project: debug-info.
Herald added a reviewer: deadalnix.
Herald added subscribers: llvm-commits, ormris, hiraditya.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
StephenTozer requested review of this revision.

Continuing further with the work from the initial RFC[0], this patch is the first step to supporting variadic debug values within the IR. This patch adds a new metadata node, DIArgList, which contains a list of SSA values.

This node is in many ways similar in function to the existing ValueAsMetadata node, with the difference being that it tracks a list instead of a single value. Internally, it uses ValueAsMetadata to track the individual values, but there is also a reasonable amount of DIArgList-specific value-tracking logic on top of that. Similar to ValueAsMetadata, it is a special case in parsing and printing due to the fact that it requires a function state (as it may reference function-local values).

This patch does not add any useful functionality; it allows for DIArgLists to be parsed and printed, but debug variable intrinsics do not yet recognize them as a valid argument (outside of parsing). This functionality will come in later patches, which should be up tomorrow.

Although this approach differs from the MIR approach (which was to use multiple values), the "variadic" approach is not suitable for an IR intrinsic: I've not been able to find any documentation or examples that make it look less complicated than adding a new metadata node; if anyone has anything to offer on that front I'm happy to take a look at it. The tracking behaviour in the DIArgList is also useful to have as it allows us to potentially respond to RAUWs that would cause a dbg.value to become `undef`, and cease tracking all of the listed SSA values at once, preventing us from needlessly processing and updating dbg.values that can only ever become empty DWARF locations.

[0] http://lists.llvm.org/pipermail/llvm-dev/2020-February/139376.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88175

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm-c/DebugInfo.h
  llvm/include/llvm/Bitcode/LLVMBitCodes.h
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/include/llvm/IR/Metadata.def
  llvm/include/llvm/IR/Metadata.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/AsmParser/LLParser.h
  llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
  llvm/lib/Bitcode/Reader/MetadataLoader.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/lib/IR/LLVMContextImpl.h
  llvm/lib/IR/Metadata.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/test/DebugInfo/Generic/debug_value_list.ll
  llvm/unittests/IR/MetadataTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88175.293808.patch
Type: text/x-patch
Size: 24553 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/a8666db4/attachment.bin>


More information about the llvm-commits mailing list