Check subrange liveness at rematerialization
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Tue, 7 Dec 2021 21:10:54 +0000 (13:10 -0800)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Mon, 13 Dec 2021 19:11:55 +0000 (11:11 -0800)
commitc4aef9c28170437372c5f9531af118d8d630f552
tree4a872720fb0b5ccab5b8fac5151d944977400ed3
parente286fefa8caaddea521685a8de1879acca82c67c
Check subrange liveness at rematerialization

LiveRangeEdit::allUsesAvailableAt checks that VNI at use is the same
as at the original use slot. However, the VNI can be the same while
a specific subrange needed for use can be dead at the new index.

This patch adds subrange liveness check if there is a subreg use.

Fixes: SWDEV-312810

Differential Revision: https://reviews.llvm.org/D115278
llvm/lib/CodeGen/LiveRangeEdit.cpp
llvm/test/CodeGen/AMDGPU/remat-dead-subreg.mir [new file with mode: 0644]