[PATCH] D44369: [SelectionDAG] Improve handling of dangling debug info

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 11 13:32:54 PDT 2018


bjope created this revision.
Herald added subscribers: JDevlieghere, eraman, aprantl.

1. Make sure to discard dangling debug info if the variable (or

variable fragment) is mapped to something new before we had a
chance to resolve the dangling debug info.

2. When resoling debug info, make sure to bump the associated

SDNodeOrder to ensure that the DBG_VALUE is emitted after the
instruction that defines the value used in the DBG_VALUE.
This will avoid a debug-use before def scenario as seen in
https://bugs.llvm.org/show_bug.cgi?id=36417.

The new test case, test/DebugInfo/X86/sdag-dangling-dbgvalue.ll,
show some other limitations in how dangling debug info is
handled in the SelectionDAG. Since we currently only support
having one dangling dbg.value per Value, we will end up dropping
debug info when there are more than one variable that is described
by the same "dangling value".


Repository:
  rL LLVM

https://reviews.llvm.org/D44369

Files:
  include/llvm/IR/DebugInfoMetadata.h
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  test/DebugInfo/X86/dbg-value-inlined-parameter.ll
  test/DebugInfo/X86/sdag-dangling-dbgvalue.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44369.137954.patch
Type: text/x-patch
Size: 18031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180311/2837c453/attachment.bin>


More information about the llvm-commits mailing list