[DebugInfo] Fix updateDbgUsersToReg to support DBG_VALUE_LIST
authorStephen Tozer <Stephen.Tozer@Sony.com>
Thu, 29 Apr 2021 15:04:24 +0000 (16:04 +0100)
committerStephen Tozer <Stephen.Tozer@Sony.com>
Fri, 7 May 2021 10:47:50 +0000 (11:47 +0100)
commit0791f968fee259e5c34523167bd58179b8b081c2
tree61521fd01293d7ac2838e575916bb1dfe3855337
parentf0762fc42f0f4ecf849bef42eed2bb4c0785ea67
[DebugInfo] Fix updateDbgUsersToReg to support DBG_VALUE_LIST

This patch modifies updateDbgUsersToReg to properly handle
DBG_VALUE_LIST instructions, by replacing the hard-coded operand indices
(i.e. getOperand(0)) with the more general getDebugOperandsForReg(), and
updating the register for all matching operands.

Differential Revision: https://reviews.llvm.org/D101523
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
llvm/lib/CodeGen/MachineCopyPropagation.cpp
llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir [new file with mode: 0644]