[LiveIntervals] Remove unused subreg ranges in repairIntervalsInRange
authorJay Foad <jay.foad@amd.com>
Mon, 27 Sep 2021 10:44:18 +0000 (11:44 +0100)
committerJay Foad <jay.foad@amd.com>
Thu, 30 Sep 2021 08:15:10 +0000 (09:15 +0100)
commit156d7d2df748fa12f1a2b3de502c12035ff8b3d6
tree5f090260aa08081907cee0dd4838e1bf93621d91
parent34d6c1822eebe2c69c850e14d48e986a5b68cbd6
[LiveIntervals] Remove unused subreg ranges in repairIntervalsInRange

If the old instructions mentioned a subreg that the new instructions do
not, remove the subrange for that subreg.

For example, in TwoAddressInstructionPass::eliminateRegSequence, if a
use operand in the REG_SEQUENCE has the undef flag then we don't
generate a copy for it so after the elimination there should be no live
interval at all for the corresponding subreg of the def.

This is a small step towards switching TwoAddressInstructionPass over
from LiveVariables to LiveIntervals. Currently this path is only tested
if you explicitly enable -early-live-intervals.

Differential Revision: https://reviews.llvm.org/D110542
llvm/lib/CodeGen/LiveIntervals.cpp
llvm/test/CodeGen/AMDGPU/dead-lane.mir
llvm/test/CodeGen/Thumb2/mve-sext-masked-load.ll