[llvm-commits] [PATCH] Linear scan allocator

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Dec 14 21:06:11 PST 2010


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 --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101214/46751a88/attachment.bin>


More information about the llvm-commits mailing list