[LLVMdev] [LLVMDev] Reg Alloc: Spiller::Spill question

David A. Greene greened at obbligato.org
Fri Jan 21 15:11:58 PST 2011


Jeff Kunkel <jdkunk3 at 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.  :)

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




More information about the llvm-dev mailing list