This is an archive of the discontinued LLVM Phabricator instance.

[LiveDebugValues] 4/4 Initial test changes for InstrRef LiveDebugValues
ClosedPublic

Authored by jmorse on Jul 2 2020, 7:46 AM.

Details

Summary

(Context: this thread http://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html )

This patch contains a bunch of test changes to account for changes in output from the new instruction-referencing LiveDebugValues. It doesn't make all tests pass if you manually demand the new LiveDebugValues -- there are still some limitations, for example I haven't attempted entry values (yet). IMHO, it's Good Enough (TM) to be in-tree, even if it isn't 100% complete yet.

About 85% of the changes here are to CHECK lines that have a trailing !debug-location: InstrRef LDV generates a DILocation for new DBG_VALUEs with only a scope, instead of copying a previous DBG_VALUEs DebugLoc, and that leads to the location being printed as:

!debug-location !DILocation(line: 0, blah blah)

instead of

!debug-location !1234

The changes in this patch just chop off the !debug-location check. I guess it's arguable as to what kind of DebugLoc we want for propagated DBG_VALUEs. At the very least though, they don't affect output DWARF.

This patch additionally fiddles with:

  • kill-after-spill.mir , where I've added a source location to each block in the program. InstrRef LDV refuses to propagate variable locations as far as the old one did, when the variables are out of scope,
  • live-debug-values-bad-transfer.mir where a known bug/limitation has been fixed, I've added instrref-and-varloc expected outputs to test for.

Finally I've added two new tests:

  • livedebugvalues_load_in_loop.mir , which shows off some multiple-location value tracking in action on a totally contrived input,
  • livedebugvalues_many_loop_heads.mir , which demonstrates a pathological input to InstrRef LDV, as explained in the test file comment.

I've got a list of other inputs that InstrRef LDV finds difficult and want coverage, but they're not submittable-quality yet. I felt it was important to get this out now and add additional tests later, if people are happy with that.

Diff Detail

Event Timeline

jmorse created this revision.Jul 2 2020, 7:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 7:46 AM
jmorse updated this revision to Diff 280457.Jul 24 2020, 7:17 AM

Add three new tests of interesting (TM) LiveDebugValues input, which I'll refer to in D83047:

llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_downgradefeedback_loop.mir
llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_insensitive_downgrade.mir
llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_path_lengths.mir
aprantl accepted this revision.Jul 27 2020, 12:56 PM
This revision is now accepted and ready to land.Jul 27 2020, 12:56 PM
djtodoro added inline comments.Jul 28 2020, 12:14 AM
llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_insensitive_downgrade.mir
77

I guess we do not need all the MF attributes here.

Thanks to all the reviewers in this series for their time!