[DebugInfo][InstrRef] Preserve properties of restored variables
authorJeremy Morse <jeremy.morse@sony.com>
Mon, 29 Nov 2021 21:55:26 +0000 (21:55 +0000)
committerJeremy Morse <jeremy.morse@sony.com>
Mon, 29 Nov 2021 21:57:24 +0000 (21:57 +0000)
commit9cf31b8d39d67843eeb314bacf6f78a1c969e1cc
treea405df5b4b242280f8c6d6bb3dd7d55f7ebe09b9
parent410d276400a9ee2440387d372db6b0f112853cc0
[DebugInfo][InstrRef] Preserve properties of restored variables

InstrRefBasedLDV observes when variable locations are clobbered, scans what
values are available in the machine, and re-issues a DBG_VALUE for the
variable if it can find another location. Unfortunately, I hadn't joined up
the Indirectness flag, so if it did this to an Indirect Value, the
indirectness would be dropped.

Fix this, and add a test that if we clobber a variable value (on the stack
in this case), then the recovered variable location keeps the Indirect
flag.

Differential Revision: https://reviews.llvm.org/D114378
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/test/DebugInfo/MIR/InstrRef/restore-clobber-with-indirectness.mir [new file with mode: 0644]