llvm-project/llvm/test
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
..
Analysis [IR] Do not assume that function pointers are aligned 2018-04-27 09:12:12 +00:00
Assembler
Bindings [LLVM-C] Add DIBuilder bindings to create import declarations 2018-04-28 22:32:07 +00:00
Bitcode augmenting description for fcmp fmf - NFC 2018-04-26 18:17:58 +00:00
BugPoint
CodeGen Revert "[mips] Fix the predicates of jump and branch and link instructions" 2018-04-30 14:03:35 +00:00
DebugInfo [BranchFolding] Salvage DBG_VALUE instructions from empty blocks 2018-04-30 14:37:46 +00:00
Examples
ExecutionEngine [RuntimeDyld][PowerPC] Fix a newly added test in r329355 2018-04-09 14:29:23 +00:00
Feature
FileCheck
Instrumentation [x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsics 2018-04-26 21:46:01 +00:00
Integer
JitListener
LTO Object: Don't mark alias unconditionally defined 2018-04-10 00:53:16 +00:00
Linker [llvm-link] Use WithColor for printing errors 2018-04-18 14:41:47 +00:00
MC [mips] Fix microMIPS loads and stores. 2018-04-30 09:44:44 +00:00
Object typo 2018-04-27 00:17:24 +00:00
ObjectYAML [WebAssembly] Add version to object file metadata 2018-04-26 18:15:32 +00:00
Other Revert "Enable EliminateAvailableExternally pass for -O1" 2018-04-26 17:54:53 +00:00
SafepointIRVerifier
SymbolRewriter
TableGen TableGen: Support Intrinsic values in SearchableTable 2018-04-01 17:08:58 +00:00
ThinLTO/X86 [lit] Fix several Python 2/3 compatibility issues and tests 2018-04-07 00:21:28 +00:00
Transforms [InstCombine] Canonicalize variable mask in masked merge 2018-04-28 15:45:07 +00:00
Unit
Verifier Tweak an assert message in the verifier 2018-04-06 10:20:19 +00:00
YAMLParser
tools [llvm-mca] Regenerate test Atom/resources-sse3.s. NFC 2018-04-30 12:13:04 +00:00
.clang-format
CMakeLists.txt Sort a target list a bit better. 2018-04-23 14:28:49 +00:00
TestRunner.sh
lit.cfg.py Enable debug fission for thinLTO linked via gold-plugin 2018-04-13 05:03:28 +00:00
lit.site.cfg.py.in