Reg Alloc: Spiller::Spill question

Spiller::Spill( LiveInterval li,
SmallVectorImpl<LiveInterval
> &newIntervals,
const SmallVectorImpl<LiveInterval*> &spillIs );

has two reference vectors which contain a small list of Live Intervals. What is the register allocator’s job to do with these intervals other than analysis. What more needed other than to know they exist?

  • Thanks
  • Jeff Kunkel

Jeff Kunkel <jdkunk3@gmail.com> writes:

Spiller::Spill( LiveInterval *li,
SmallVectorImpl<LiveInterval*> &newIntervals,
const SmallVectorImpl<LiveInterval*> &spillIs );

has two reference vectors which contain a small list of Live
Intervals. What is the register allocator's job to do with these
intervals other than analysis. What more needed other than to know
they exist?

It's been a while since I looked at this, so Evan can correct any
mistakes I make. :slight_smile:

spillIs is passed into the spiller and indicates the intervals that
alias the interval being spilled. In other words, they indicate
registers that are sub-/super-registers of the one being spilled. These
intervals must be spilled along with the "primary" one.

I think this comes into play in linear scan when it has to force a
reallocation of a physical register and must backtrack. The details of
this are very fuzzy to me.

The newIntervals vector gets filled in by LiveIntervalAnalysis with the
new intervals created when spilling in done. Spilling is essentially a
splitting of a live interval into multiple sub-intervals. Those
sub-intervals will need to be allocated to registers. The newIntervals
output tells the register allocator the new intervals it must add to its
work queue.

                             -Dave

Thanks, I think I have figured it out. However, I moved on to SplitEditor class. It was quite well done; I must say. Although the SpillAnalysis is a bit heavy-weight for the stuff I would like to do.

  • Jeff