[DebugInfo] Handle joins PHI+Def values in InstrRef LiveDebugValues
commit53125e7d916306582bee0c828d38d1ef6d6061dc
authorStephen Tozer <stephen.tozer@sony.com>
Tue, 17 May 2022 14:35:27 +0000 (17 15:35 +0100)
committerStephen Tozer <stephen.tozer@sony.com>
Mon, 22 Aug 2022 13:51:27 +0000 (22 14:51 +0100)
tree0b5d15a4bb04378cb71dba6fb902c8312718a367
parente2ab6061a976400df672842dc2af76b527fa421a
[DebugInfo] Handle joins PHI+Def values in InstrRef LiveDebugValues

In the InstrRefBasedImpl for LiveDebugValues, we attempt to propagate
debug values through basic blocks in part by checking to see whether all
a variable's incoming debug values to a BB "agree", i.e. whether their
properties match and they refer to the same underlying value.

Prior to this patch, the check for agreement between incoming values
relied on exact equality, which meant that a VPHI and a Def DbgValue
that referred to the same underlying value would be seen as disagreeing.
This patch changes this behaviour to treat them as referring to the same
value, allowing the shared value to propagate into the BB.

Differential Revision: https://reviews.llvm.org/D125953
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/test/DebugInfo/MIR/X86/instr-ref-join-def-vphi.mir [new file with mode: 0644]
llvm/unittests/CodeGen/InstrRefLDVTest.cpp