]> granicus.if.org Git - llvm/commit
[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Wed, 14 Aug 2019 12:20:02 +0000 (12:20 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Wed, 14 Aug 2019 12:20:02 +0000 (12:20 +0000)
commit04fd1a03bc6ab0162c1f634949969adb832aa0a2
treef794dee0def7824fec4d8c18346d16fbe50c99c2
parentfc528d0c817d32db8595d49ce0e9fdb0134568af
[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block

MCP currently uses changeDebugValuesDefReg / collectDebugValues to find
debug users of a register, however those functions assume that all
DBG_VALUEs immediately follow the specified instruction, which isn't
necessarily true. This is going to become very often untrue when we turn
off CodeGenPrepare::placeDbgValues.

Instead of calling changeDebugValuesDefReg on an instruction to change its
debug users, in this patch we instead collect DBG_VALUEs of copies as we
iterate over insns, and update the debug users of copies that are made
dead. This isn't a non-functional change, because MCP will now update
DBG_VALUEs that aren't immediately after a copy, but refer to the same
register. I've hijacked the regression test for PR38773 to test for this
new behaviour, an entirely new test seemed overkill.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368835 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/MachineCopyPropagation.cpp
test/CodeGen/MIR/X86/pr38773.mir