2.5 Regalloc Assert

I am hitting this assert in LLVM 2.5:

/// spillPhysRegAroundRegDefsUses - Spill the specified physical register
/// around all defs and uses of the specified interval.
void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li,
                                            unsigned PhysReg, VirtRegMap &vrm)
{
  unsigned SpillReg = getRepresentativeReg(PhysReg);

  for (const unsigned *AS = tri_->getAliasSet(PhysReg); *AS; ++AS)
    // If there are registers which alias PhysReg, but which are not a
    // sub-register of the chosen representative super register. Assert
    // since we can't handle it yet.
    assert(*AS == SpillReg || !allocatableRegs_[*AS] ||
           tri_->isSuperRegister(*AS, SpillReg));

The test also asserts on trunk, though with an error about running out
of registers. I am working to file a bug.

I am also going to try 2.6.

Any hints on what might be going on?

                               -Dave

I am hitting this assert in LLVM 2.5:

/// spillPhysRegAroundRegDefsUses - Spill the specified physical register
/// around all defs and uses of the specified interval.
void LiveIntervals::spillPhysRegAroundRegDefsUses(const LiveInterval &li,
                                           unsigned PhysReg, VirtRegMap &vrm)
{
unsigned SpillReg = getRepresentativeReg(PhysReg);

for (const unsigned *AS = tri_->getAliasSet(PhysReg); *AS; ++AS)
   // If there are registers which alias PhysReg, but which are not a
   // sub-register of the chosen representative super register. Assert
   // since we can't handle it yet.
   assert(*AS == SpillReg || !allocatableRegs_[*AS] ||
          tri_->isSuperRegister(*AS, SpillReg));

The test also asserts on trunk, though with an error about running out
of registers. I am working to file a bug.

The allocator cannot find a virtual register interval to spill. So it's attempting to slice up a physical register interval to free up a register around the uses and defs of interval li.

Looks like it's unable to find a suitable register to do so.

Evan