Skip to content

[GreedyRA] Assert triggered: "Non-empty but used interval" #55827

Closed
@serguei-katkov

Description

@serguei-katkov

The test below triggers an assert in greedy register allocator.

At the moment I see the following reason of an assert:

  1. During last chance recoloring some live interval is unassigned from physical register
  2. Then it is split by region split and completely replaces by others live intervals corresponding to new registers. On this stage instructions are updated.
  3. 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).
  4. Later on handling another live interval , our live interval is evicted.
  5. 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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions