[PATCH] D101523: [DebugInfo] Fix updateDbgUsersToReg to support DBG_VALUE_LIST

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 06:13:09 PDT 2021


StephenTozer updated this revision to Diff 344037.
StephenTozer added a comment.

The previous version of the patch was handling subregisters incorrectly; the `updateDbgUsersToReg` function assumed that each operand `MO` that corresponded to `OldReg`would satisfy `MO.getReg() == OldReg` - this is correct for virtual registers, which use the `subReg` field, but not for physical registers.

To fix the issue, `updatedbgUsersToReg` has been modified to take `MCRegister`s as arguments, and checks each debug operand for the target `DBG_VALUE*` instruction to see if it has any RegUnits in common with `OldReg`; if it does, then we replace it with `NewReg`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101523/new/

https://reviews.llvm.org/D101523

Files:
  llvm/include/llvm/CodeGen/MachineRegisterInfo.h
  llvm/lib/CodeGen/MachineCopyPropagation.cpp
  llvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101523.344037.patch
Type: text/x-patch
Size: 12693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210510/8077762d/attachment.bin>


More information about the llvm-commits mailing list