[DebugInfo][InstrRef] Fix error in copy handling in InstrRefLDV
authorStephen Tozer <stephen.tozer@sony.com>
Mon, 20 Jun 2022 09:41:15 +0000 (10:41 +0100)
committerStephen Tozer <stephen.tozer@sony.com>
Mon, 11 Jul 2022 12:38:23 +0000 (13:38 +0100)
commitf9ac161af9d9c3af03cda25497a7280f51fd92ac
tree6dec156d1c8488dab0ce39885216c3b31a271613
parent6e2329e33ae3f0239785af0fb69bf73ebe3b8899
[DebugInfo][InstrRef] Fix error in copy handling in InstrRefLDV

Currently, an error exists when InstrRefBasedLDV observes transfers of
variables across copies, which causes it to lose track of variables
under certain circumstances, resulting in shorter lifetimes for those
variables as LDV gives up searching for live locations for them. This
patch fixes this issue by storing the currently tracked values in
the destination first, then updating them manually later without
clobbering or assigning them the wrong value.

Differential Revision: https://reviews.llvm.org/D128101
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/test/DebugInfo/X86/instr-ref-track-clobbers.mir [new file with mode: 0644]