Page MenuHomePhabricator

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

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
1546

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

1550

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
1546

"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".

1550

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
835

early continue?

8513

Please add a message into the assertion.

8576

Please add a message into the assertion.

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
1142

Please add a message into the assertion.

1291

Please add a message into the assertion.

1383

Please add a message into the assertion.

1389

Nit: These comments should go above.

5892

Should we add an assertion here?