[LiveDebugValues][InstrRef][1/2] Recover more clobbered variable locations
authorJeremy Morse <jeremy.morse@sony.com>
Tue, 29 Jun 2021 17:50:24 +0000 (18:50 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Wed, 30 Jun 2021 15:56:25 +0000 (16:56 +0100)
commit49555441628a0ec620581bba371e6bb20c2b3f5f
treec6fc24e8a8c179afe851a077d7b4202e6c10ec8a
parentecabc6684f23cb65925d62fac9a14ab52d07951a
[LiveDebugValues][InstrRef][1/2] Recover more clobbered variable locations

In various circumstances, when we clobber a register there may be
alternative locations that the value is live in. The classic example would
be a value loaded from the stack, and then clobbered: the value is still
available on the stack. InstrRefBasedLDV was coping with this at block
starts where it's forced to pick a location, however it wasn't searching
for alternative locations when values were clobbered.

This patch notifies the "Transfer Tracker" object when clobbers occur, and
it's able to find alternatives and issue DBG_VALUEs for that location. See:
the added test.

Differential Revision: https://reviews.llvm.org/D88405
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_instrref_tolocs.mir
llvm/test/DebugInfo/MIR/InstrRef/livedebugvalues_recover_clobbers.mir [new file with mode: 0644]
llvm/test/DebugInfo/MIR/X86/livedebugvalues_load_in_loop.mir