[SlotIndexes] Fix and simplify basic block splitting
authorJay Foad <jay.foad@amd.com>
Fri, 8 Jan 2021 13:40:29 +0000 (13:40 +0000)
committerJay Foad <jay.foad@amd.com>
Tue, 12 Jan 2021 10:50:14 +0000 (10:50 +0000)
commitf264f9ad7df538357dfc8c5f318c5c8b0df3d99f
tree384092831f76016c209306c0262840975dafaa3b
parentc1e08f0073e35cf17c0a0343cf7efff914dbd66d
[SlotIndexes] Fix and simplify basic block splitting

Remove the InsertionPoint argument from SlotIndexes::insertMBBInMaps
because it was confusing: what does it mean to insert a new block
between two instructions, in the middle of an existing block?

Instead, support the case that MachineBasicBlock::splitAt really needs,
where the new block contains some instructions that are already in the
maps because they have been moved there from the tail of the previous
block.

In all other use cases the new block is empty.

Based on work by Carl Ritson!

Differential Revision: https://reviews.llvm.org/D94311
llvm/include/llvm/CodeGen/LiveIntervals.h
llvm/include/llvm/CodeGen/SlotIndexes.h
llvm/lib/CodeGen/MachineBasicBlock.cpp
llvm/unittests/MI/LiveIntervalTest.cpp