hanchenye-llvm-project/llvm/test/DebugInfo
Bjorn Pettersson 9a8483a4b2 [BranchFolding] Salvage DBG_VALUE instructions from empty blocks
Summary:
This patch will introduce copying of DBG_VALUE instructions
from an otherwise empty basic block to predecessor/successor
blocks in case the empty block is eliminated/bypassed. It
is currently only done in one identified situation in the
BranchFolding pass, before optimizing on empty block.
It can be seen as a light variant of the propagation done
by the LiveDebugValues pass, which unfortunately is executed
after the BranchFolding pass.

We only propagate (copy) DBG_VALUE instructions in a limited
number of situations:
 a) If the empty BB is the only predecessor of a successor
    we can copy the DBG_VALUE instruction to the beginning of
    the successor (because the DBG_VALUE instruction is always
    part of the flow between the blocks).
 b) If the empty BB is the only successor of a predecessor
    we can copy the DBG_VALUE instruction to the end of the
    predecessor (because the DBG_VALUE instruction is always
    part of the flow between the blocks). In this case we add
    the DBG_VALUE just before the first terminator (assuming
    that the terminators do not impact the DBG_VALUE).

A future solution, to handle more situations, could perhaps
be to run the LiveDebugValues pass before branch folding?

This fix is related to PR37234. It is expected to resolve
the problem seen, when applied together with the fix in
SelectionDAG from here: https://reviews.llvm.org/D46129

Reviewers: #debug-info, aprantl, rnk

Reviewed By: #debug-info, aprantl

Subscribers: ormris, gbedwell, llvm-commits

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

llvm-svn: 331183
2018-04-30 14:37:46 +00:00
..
AArch64 [SelectionDAG] Transfer DbgValues when integer operations are promoted 2018-03-19 22:58:50 +00:00
AMDGPU AMDGPU: Really implement getFrameRegister 2018-03-27 23:26:59 +00:00
ARM
COFF [SelectionDAG] Improve selection of DBG_VALUE using a PHI node result 2018-04-30 14:37:39 +00:00
Generic Fix macosx build broken by r330249 2018-04-18 15:23:21 +00:00
Inputs [Debuginfo][COFF] Minimal serialization support for precompiled types records 2018-04-09 20:17:56 +00:00
Lanai
MIR [MIR] Add support for debug metadata for fixed stack objects 2018-04-25 18:58:06 +00:00
MSP430
Mips [FastISel] Disable local value sinking by default 2018-04-11 16:03:07 +00:00
NVPTX Fix path separator checks on Windows 2018-04-24 22:03:07 +00:00
PDB [llvm-pdbutil] Dump first section contribution for each module. 2018-04-17 20:06:43 +00:00
PowerPC
Sparc
SystemZ
WebAssembly [WebAssembly] Add DebugLoc information to WebAssembly block and loop. 2018-03-15 22:06:51 +00:00
X86 [BranchFolding] Salvage DBG_VALUE instructions from empty blocks 2018-04-30 14:37:46 +00:00
arm-relocs.test
cross-cu-scope.ll
debugify.ll
debuglineinfo-macho.test
debuglineinfo-path.ll Disable test debuglineinfo-path on powerpc 2018-03-14 02:10:07 +00:00
debuglineinfo.test
debugmacinfo.test
dwarfdump-64-bit-dwarf.test
dwarfdump-accel.test
dwarfdump-debug-frame-simple.test
dwarfdump-decompression-corrupt.test
dwarfdump-decompression-error.test
dwarfdump-dump-flags.test
dwarfdump-dump-gdbindex.test
dwarfdump-dwp.test
dwarfdump-implicit-const.test
dwarfdump-invalid-line-table.test
dwarfdump-invalid.test
dwarfdump-macho-relocs.test
dwarfdump-macho-universal.test [dsymutil] Rename llvm-dsymutil -> dsymutil 2018-03-18 11:38:41 +00:00
dwarfdump-objc.test
dwarfdump-pubnames.test
dwarfdump-ranges.test
dwarfdump-type-units.test
dwarfdump-zlib.test
dwo.ll
invalid-relocations.test
llvm-symbolizer-split-dwarf-empty.test
llvm-symbolizer-split-dwarf-no-skel-address.test
llvm-symbolizer-zlib.test
llvm-symbolizer.test
macro_link.ll
member-pointers.o
missing-abstract-variable.o
omit-empty.ll
pr34186.ll
pr34672.ll
precomp.test [Debuginfo][COFF] Minimal serialization support for precompiled types records 2018-04-09 20:17:56 +00:00
skeletoncu.ll
strip-DIGlobalVariable.ll
strip-loop-metadata.ll
typeunit-header.test
unrolled-loop-remainder.ll