]> granicus.if.org Git - llvm/commit
Merging r326769 and r326780:
authorTom Stellard <tstellar@redhat.com>
Tue, 10 Apr 2018 04:13:19 +0000 (04:13 +0000)
committerTom Stellard <tstellar@redhat.com>
Tue, 10 Apr 2018 04:13:19 +0000 (04:13 +0000)
commit2b9ba6c2236f4605b9c31b222fe7cd6ae5cca7a2
tree032c2d129e09a230b934c7792ef042e91ec10e79
parent54d8b1a9f397a6ead6442391bc86ef147aaad378
Merging r326769 and r326780:

------------------------------------------------------------------------
r326769 | bjope | 2018-03-06 00:47:07 -0800 (Tue, 06 Mar 2018) | 28 lines

[DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables

Summary:
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

Reviewers: aprantl, rnk, probinson

Reviewed By: aprantl

Subscribers: vsk, davide, alexcrichton, Ka-Ka, eraman, llvm-commits, JDevlieghere

Differential Revision: https://reviews.llvm.org/D43956
------------------------------------------------------------------------

------------------------------------------------------------------------
r326780 | bjope | 2018-03-06 05:23:28 -0800 (Tue, 06 Mar 2018) | 6 lines

Fixup for rL326769 (RegState::Debug is being truncated to a bool)

I obviously messed up arguments to MachineOperand::CreateReg
in rL326769. This should make it work as intended.

Thanks to RKSimon for spotting this.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@329668 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveDebugVariables.cpp
test/DebugInfo/X86/dbg-value-inlined-parameter.ll
test/DebugInfo/X86/live-debug-vars-discard-invalid.mir [new file with mode: 0644]