[DebugInstrRef][2/3] Track PHI values through register coalescing
authorJeremy Morse <jeremy.morse@sony.com>
Thu, 3 Jun 2021 15:43:49 +0000 (16:43 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Thu, 3 Jun 2021 16:06:51 +0000 (17:06 +0100)
commitae4303b42cfa5c8c14e3fff67d73af2f154aea9a
treeade1a203aa94f0296befd1c998dd767f94d99539
parent6881f29a36a97102e5c89653a343f656231bc2f2
[DebugInstrRef][2/3] Track PHI values through register coalescing

In the instruction referencing variable location model, we store variable
locations that point at PHIs in MachineFunction during register
allocation. Unfortunately, register coalescing can substantially change
the locations of registers, and so that PHI-variable-location side table
needs maintenence during the pass.

This patch builds an index from the side table, and whenever a vreg gets
coalesced into another vreg, update the index to record the new vreg that
the PHI happens in. It also accepts a limited range of subregister
coalescing, for example merging a subregister into a larger class.

Differential Revision: https://reviews.llvm.org/D86813
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/DebugInfo/MIR/InstrRef/phi-coalesce-subreg.mir [new file with mode: 0644]
llvm/test/DebugInfo/MIR/InstrRef/phi-coalescing.mir [new file with mode: 0644]