[PATCH] D66663: [DebugInfo] LiveDebugValues should always revisit backedges if it skips them

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 10:11:14 PDT 2019


jmorse updated this revision to Diff 217424.
jmorse added a comment.
Herald added a subscriber: javed.absar.

This update removes the "initialisation" phase that was happening in LiveDebugValues, and doing so fixes the original problem I was trying to solve, horray.

The change in logic (the |= to `MBBJoined`) forces all blocks to be joined again after the first pass through. Before, the "join" logic for unvisited predecessors was effectively firing on the _second_ pass through because OutLocs was already initialised. Now that happens on the first pass, and it correctly sees added/missing locations on the second pass through.

I've eliminated the initialization flag for the "process" method while doing this, as I can't find any reason for it to exist. All the instructions get processed for transfers at least once, just as before, and no tests fail. I've added a MIR regression test for the behaviour where the entry block not being revisited will lead to transfers there not being recognised, which is another thing fixed by getting rid of the initialisation.

compiler-gen-bbs-livedebugvalues.mir: This test now recognises a stack spill and creates a second DBG_VALUE, where LiveDebugVariables has already created a DBG_VALUE. This is annoying, but not faulty IMO.

debug-info-blocks.ll: is more problematic. It seems a hash-collision and PR43058 [0] causes a stack-load of a return address to be recognised as a variable transfer, which I've XFailed. I haven't committed in the fix for PR43058 because of what I've written on bugzilla; IMHO it's best to xfail this test and move forwards, although we could also leave the patch hanging until PR43058 is done.

There are negligible differences in the debug statistics for a clang-3.4 build.

[0] https://bugs.llvm.org/show_bug.cgi?id=43058


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66663/new/

https://reviews.llvm.org/D66663

Files:
  lib/CodeGen/LiveDebugValues.cpp
  test/CodeGen/ARM/debug-info-blocks.ll
  test/DebugInfo/AArch64/compiler-gen-bbs-livedebugvalues.mir
  test/DebugInfo/MIR/X86/live-debug-values-entry-transfer.mir
  test/DebugInfo/X86/DW_AT_location-reference.ll
  test/DebugInfo/X86/live-debug-values-remove-range.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66663.217424.patch
Type: text/x-patch
Size: 15415 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190827/0ed1eb1c/attachment-0001.bin>


More information about the llvm-commits mailing list