This is an archive of the discontinued LLVM Phabricator instance.

[NFC][LiveDebugvalues] Document how LiveDebugValues operates
ClosedPublic

Authored by jmorse on Jun 1 2020, 8:12 AM.

Details

Summary

This is a docu-comment for the LiveDebugValues pass explaining what it does, and how it's structured. I remembered I was going to write this up; see D67500 for some thrashing out of what the pass Really (TM) does.

The lattice could be presented as going up or down, or be mirrored; which way doesn't bother me.

Diff Detail

Event Timeline

jmorse created this revision.Jun 1 2020, 8:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2020, 8:12 AM
jmorse marked an inline comment as done.Jun 1 2020, 8:13 AM
jmorse added inline comments.
llvm/lib/CodeGen/LiveDebugValues.cpp
9–13

(This was determined to be probably-wrong in another review, that I forget the details of. DBG_VALUEs don't change meaning, there are just very few of them if LiveDebugValues doesn't run).

Orlando added a subscriber: Orlando.Jun 1 2020, 8:48 AM
Orlando added inline comments.
llvm/lib/CodeGen/LiveDebugValues.cpp
101

nit: with it's bit -> with its bit.

vsk added a comment.Jun 1 2020, 9:25 AM

This is really nice, thanks.

llvm/lib/CodeGen/LiveDebugValues.cpp
46

nit, DbgEntityHistoryCalculator?

64

nit, extra 'blocks'?

65

I don't follow this part: "except in the entry block where they [all DebugVariable locations that are live-out of a block] are \bot". Wouldn't that mean that a DebugVariable referenced in the entry block is unavailable in every other block?

jmorse updated this revision to Diff 267651.Jun 1 2020, 9:49 AM
jmorse marked an inline comment as done.

Fixed some typos, fix and reshuffle the "Formally" paragraph.

jmorse marked 4 inline comments as done.Jun 1 2020, 9:51 AM
jmorse added inline comments.
llvm/lib/CodeGen/LiveDebugValues.cpp
65

Ah, that was an off-by-one, I should have written that the live-INS for the entry block are all \bot. I've fixed that and rotated the paragraph to have a different order, hopefully the same message comes across.

vsk accepted this revision.Jun 1 2020, 10:19 AM

Looks great!

This revision is now accepted and ready to land.Jun 1 2020, 10:19 AM
aprantl accepted this revision.Jun 1 2020, 10:34 AM

Awesome! Couple of nits inside.

llvm/lib/CodeGen/LiveDebugValues.cpp
22

Doesn't it also support constants and memory locations?

variable -> variable (fragment)

50
\verbatim
...
\endverbatim
57

Do we allow unicode characters (for top / bot) in the sources?

88

\p VarLocMap might turn this into a link, but I'm not sure.

89

indices?

djtodoro accepted this revision.Jun 1 2020, 11:17 PM

Cool, thanks!

llvm/lib/CodeGen/LiveDebugValues.cpp
75

Nit: To stay consistent "True"/"False".

jmorse updated this revision to Diff 271116.Jun 16 2020, 9:11 AM
jmorse marked 6 inline comments as done.

Fixed some nits; note that it seems \endverbatim has to go on the same line as the continuing normal environment; otherwise for some reason the rest of the file ends up being \verb too.

I've added a \file command at the top too, as Doxygen doesn't appear to add the file comment otherwise.

llvm/lib/CodeGen/LiveDebugValues.cpp
57

Good question, I couldn't find anything in the developer policies. After a brief survey I found a few grave's '’ ' scattered around, and one section marker I forget the name of: §. All were in comments rather than the source bodies.

Building doxygen with the literal top and bottom characters appears to work and render OK, so IMO this should be fine to check in.

This revision was automatically updated to reflect the committed changes.