Fix out-of-order stepping behavior in programs with sunk instructions.
authorPaul Robinson <paul.robinson@sony.com>
Mon, 20 Nov 2017 18:42:17 +0000 (18:42 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Mon, 20 Nov 2017 18:42:17 +0000 (18:42 +0000)
commitf0b02965e4736af445505a30840fe2b63fa3d2f7
tree222eb77bc18d28bd3b7b2ff1290d42a43221f52a
parent3669061298f694d9c060e530fb9b4ec633b7b0e6
Fix out-of-order stepping behavior in programs with sunk instructions.

MachineSink attempts to place instructions near the basic blocks where
they are needed.  Once an instruction has been sunk, its location
relative to other instructions is no longer consistent with the
original source code. In order to ensure correct single-stepping and
profiling, the debug location for sunk instructions is either merged
with the insertion point or erased if the target successor block is
empty.

Patch by Matthew Voss!

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

llvm-svn: 318679
llvm/lib/CodeGen/MachineSink.cpp
llvm/test/CodeGen/X86/machinesink-debuginfo.ll [new file with mode: 0644]