[llvm-commits] [PATCH] Linear scan allocator

Krister Wombell kuwerty at gmail.com
Wed Dec 15 01:26:05 PST 2010


Hi Jakob,

Could you please not commit this for the moment.   I've noticed that
the spill weights for some phys regs are not infinite.  If I force the
weight to be infinite (as it should always be for phys regs?) with a
debugger then it avoids findIntervalsToSpill completely.  Looks like the
root of the bug is elsewhere.

Thanks, Krister



On Wed, Dec 15, 2010 at 1:06 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

>
> On Dec 14, 2010, at 7:25 PM, Krister Wombell wrote:
>
> > I've come across a bug in RALinScan::assignRegOrStackSlotAtInterval that
> occurs when:
> >
> > - an interval conflicts with all physical registers in it's class
> > - and one of the phys regs has a lower spill weight then the interval
> being assigned
> > - and there are no active or inactive intervals (or no entries of an
> overlapping reg class)
> >
> > findIntervalsToSplit then runs but won't be able to find the best
> candidate as it fails to find a anything suitable in the 'active_' or
> 'inactive_' lists. The code asserts that there's nothing to spill.
> >
> > It's a fairly obscure set of circumstances but can happen if there is a
> register class with no callee saved registers and a call instruction (that
> implicitly defines all registers in that class).  It (probably?) also
> requires that the interval being assigned is itself the result of spilling
> as both the spill weight needs to be quite high.
> >
> > I've attached a fix that spills the current interval if
> findIntervalsToSplit returns nothing.
>
> It looks reasonable, do you have a test case?
>
> /jakob
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101215/ee5d8365/attachment.html>


More information about the llvm-commits mailing list