[DebugInfo][InstrRef] Track all of DBG_PHIs operands
authorJeremy Morse <jeremy.morse@sony.com>
Tue, 5 Oct 2021 12:44:40 +0000 (13:44 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Tue, 5 Oct 2021 13:01:26 +0000 (14:01 +0100)
commite265644b324424bbc00185293594d3207150ee6e
tree8019a462e4547adf4eb47e2b406ff29db2ec36d5
parent8737c74fab3aee833d85b7d235d2c47ebb4eed2e
[DebugInfo][InstrRef] Track all of DBG_PHIs operands

An important part of the instruction referencing solution is that we
identify all the registers that values move between before we then compute
an SSA-like function from the machine code, and from the variable
intrinsics. DBG_PHIs weren't causing all the subregisters of their operands
to be tracked; this patch forces that to happen.

The practical implications were that not enough space is allocated for
storing values when analysing the function -- asan will crash on the
attached test case with an unpatched compiler. Non-asan llc's will produce
a DBG_VALUE $noreg, where it should be $dil.

Differential Revision: https://reviews.llvm.org/D109064
llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
llvm/test/DebugInfo/MIR/InstrRef/dbg-phi-subregister-location.mir [new file with mode: 0644]