OSDN Git Service

[DebugInfo] Honour variable fragments in LiveDebugValues
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 13 Jun 2019 12:51:57 +0000 (12:51 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 13 Jun 2019 12:51:57 +0000 (12:51 +0000)
commitd7e357f858172c57dd2663ef287dca0e71c04218
tree612f37a71ef2a75de32fb77ac3b72b3b965e1462
parente4a2667a65890cbd6319a3298603e221cfd80f7a
[DebugInfo] Honour variable fragments in LiveDebugValues

This patch makes the LiveDebugValues pass consider fragments when propagating
DBG_VALUE insts between blocks, fixing PR41979. Fragment info for a variable
location is added to the open-ranges key, which allows distinct fragments to be
tracked separately. To handle overlapping fragments things become slightly
funkier. To avoid excessive searching for overlaps in the data-flow part of
LiveDebugValues, this patch:
 * Pre-computes pairings of fragments that overlap, for each DILocalVariable
 * During data-flow, whenever something happens that causes an open range to
   be terminated (via erase), any fragments pre-determined to overlap are
   also terminated.

The effect of which is that when encountering a DBG_VALUE fragment that
overlaps others, the overlapped fragments do not get propagated to other
blocks. We still rely on later location-list building to correctly handle
overlapping fragments within blocks.

It's unclear whether a mixture of DBG_VALUEs with and without fragmented
expressions are legitimate. To avoid suprises, this patch interprets a
DBG_VALUE with no fragment as overlapping any DBG_VALUE _with_ a fragment.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363256 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugInfoMetadata.h
lib/CodeGen/LiveDebugValues.cpp
test/DebugInfo/ARM/partial-subreg.ll
test/DebugInfo/MIR/X86/live-debug-values-fragments.mir [new file with mode: 0644]