[PATCH] D43956: [DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 10:13:50 PST 2018


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

This is a workaround for pr36417
https://bugs.llvm.org/show_bug.cgi?id=36417

LiveDebugVariables will now verify that the DBG_VALUE instructions
are sane (prior to register allocation) by asking LIS if a virtual
register used in the DBG_VALUE is live (or dead def) in the slot
index before the DBG_VALUE. If it isn't sane the DBG_VALUE is
discarded.

One pass that was identified as introducing non-sane DBG_VALUE
instructtons, when analysing pr36417, was the DAG->DAG Instruction
Selection. It sometimes inserts DBG_VALUE instructions referring to
a virtual register that is defined later in the same basic block.
So it is a use before def kind of problem. The DBG_VALUE is
typically inserted in the beginning of a basic block when this
happens. The problem can be seen in the test case
test/DebugInfo/X86/dbg-value-inlined-parameter.ll

Change-Id: Ia55df65fbfb6d3bc561df4c1e27fd36d0e61e505


Repository:
  rL LLVM

https://reviews.llvm.org/D43956

Files:
  lib/CodeGen/LiveDebugVariables.cpp
  test/DebugInfo/X86/dbg-value-inlined-parameter.ll
  test/DebugInfo/X86/live-debug-vars-discard-invalid.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43956.136568.patch
Type: text/x-patch
Size: 9388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180301/5a5842b6/attachment.bin>


More information about the llvm-commits mailing list