]> granicus.if.org Git - llvm/commit
[DebugInfo] LiveDebugValues should always revisit backedges if it skips them
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 29 Aug 2019 10:53:29 +0000 (10:53 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 29 Aug 2019 10:53:29 +0000 (10:53 +0000)
commit228c7780c56517a2454f8299ab08115b570d510c
tree8ced5e1919094e298bee19612da73b091baaacf0
parent161b88e517089db1134ce3e9fe9e4a25bc1f204d
[DebugInfo] LiveDebugValues should always revisit backedges if it skips them

The "join" method in LiveDebugValues does not attempt to join unseen
predecessor blocks if their out-locations aren't yet initialized, instead
the block should be re-visited later to see if any locations have changed
validity. However, because the set of blocks were all being "process"'d
once before "join" saw them, that logic in "join" was actually ignoring
legitimate out-locations on the first pass through. This meant that some
invalidated locations were not removed from the head of loops, allowing
illegal locations to persist.

Fix this by removing the run of "process" before the main join/process loop
in ExtendRanges. Now the unseen predecessors that "join" skips truly are
uninitialized, and we come back to the block at a later time to re-run
"join", see the @baz function added.

This also fixes another fault where stack/register transfers in the entry
block (or any other before-any-loop-block) had their tranfers initially
ignored, and were then never revisited. The MIR test added tests for this
behaviour.

XFail a test that exposes another bug; a fix for this is coming in D66895.

Differential Revision: https://reviews.llvm.org/D66663

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370328 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]
test/DebugInfo/X86/DW_AT_location-reference.ll
test/DebugInfo/X86/live-debug-values-remove-range.ll