Closed
Description
The test below triggers an assert in greedy register allocator.
At the moment I see the following reason of an assert:
- During last chance recoloring some live interval is unassigned from physical register
- Then it is split by region split and completely replaces by others live intervals corresponding to new registers. On this stage instructions are updated.
- If re-coloring failed, the rollback is started. On this stage the original live interval corresponding to original register which does not have any uses now is assigned back to original physical register (it looks very strange).
- Later on handling another live interval , our live interval is evicted.
- Finally RegAllocBase in allocatePhysRegs complains with assert that Live interval has no nodbg uses but interval is not empty.
How to reproduce:
$ llc -x mir -mattr="+reserve-x28" --start-before=greedy 5.mir
...RegAllocBase.cpp:152: void llvm::RegAllocBase::allocatePhysRegs(): Assertion `SplitVirtReg->empty() && "Non-empty but used interval"' failed
The reproducer is attached as 5.txt in the next comment.