[PATCH] D89941: [DebugInfo] Clear subreg in setDebugValueUndef()

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 02:54:22 PDT 2020


dstenb created this revision.
dstenb added reviewers: StephenTozer, djtodoro, vsk, jmorse.
dstenb added a project: debug-info.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
dstenb requested review of this revision.

When switching the register debug operands to $noreg in
setupDebugValueUndef() also clear the sub-register indices for virtual
registers. This is done when marking DBG_VALUEs undef in other cases,
e.g. in LiveDebugVariables. I have not found any cases where leaving the
sub-register index causes any issues, and the indices would eventually
get dropped when LiveDebugVariables reinserted the undef DBG_VALUEs
after register scheduling, but if nothing else it looked a bit weird in
printouts to have sub-register indices on $noreg, and I don't think the
sub-register index holds any meaningful information at that point.

I have not been able to find any source-level reproducer for this with
an upstream target, so I have just added an instrumented machine-sink
test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89941

Files:
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/test/DebugInfo/MIR/X86/machinesink-subreg.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89941.299905.patch
Type: text/x-patch
Size: 4045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201022/4fa9b87e/attachment.bin>


More information about the llvm-commits mailing list