This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Handle dbg.values with multiple variable location operands in ISel
ClosedPublic

Authored by StephenTozer on Sep 30 2020, 9:53 AM.

Details

Summary

This patch continues implementing the ISel support for multi-location-operand debug values by reading and processing dbg.values that use DIArgList. This patch does not add support for producing DBG_VALUE_LIST; that is added in a separate patch in this stack.

The most substantial change is naturally in handleDebugValue and some of the functions that it calls. Outside of this, salvageDebugInfo and transferDbgValues have been modified to replace individual operands instead of the entire value; dangling debug info for variadic debug values is not currently supported (but may be added in a later patch).

Diff Detail

Event Timeline

StephenTozer created this revision.Sep 30 2020, 9:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2020, 9:53 AM
StephenTozer requested review of this revision.Sep 30 2020, 9:53 AM

Rebase onto recent master, no functional changes.

aprantl accepted this revision.Dec 10 2020, 8:52 AM

Mechanically this looks fine.

llvm/include/llvm/CodeGen/SelectionDAG.h
7

It would be nice if we can find a less overloaded term than "locations". Perhaps just call them straight DW_OP_LLVM_args?

11

is IsVariadic the same as Locs.size() > 1?

This revision is now accepted and ready to land.Dec 10 2020, 8:52 AM
StephenTozer added inline comments.Dec 10 2020, 9:46 AM
llvm/include/llvm/CodeGen/SelectionDAG.h
7

"Location Operands" is one more-specific term that has been used, although in this case we could also just say "from a list of SDDbgOperands", or "from a list of machine locations".

11

No; IsVariadic refers to whether or not this debug value uses a list of operands, even if it's a list with 1 element, so that we always map dbg.value(metadata <value>, ...) to DBG_VALUE, and dbg.value(metadata !DIArgList(<value>), ...) to DBG_VALUE_LIST.

djtodoro added inline comments.Dec 11 2020, 1:09 AM
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
82

Please add a message into the assertion.

82

Please add a message into the assertion.

89

early continue?

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
60–1

Nit: These comments should go above.

61

Please add a message into the assertion.

62

Should we add an assertion here?

62

Please add a message into the assertion.

81

Please add a message into the assertion.

This revision was landed with ongoing or failed builds.Mar 9 2021, 2:13 AM
This revision was automatically updated to reflect the committed changes.