Debugging info on # spills?

Daniel Berlin dberlin@dberlin.org
Wed Apr 7 16:16:00 GMT 2004


On Apr 7, 2004, at 12:10 PM, Vladimir Makarov wrote:

> Daniel Berlin wrote:
>
>>
>> On Apr 7, 2004, at 9:37 AM, Michael Matz wrote:
>>
>>> Hi,
>>>
>>> On Tue, 6 Apr 2004, Timothy J. Wood wrote:
>>>
>>>>   Is there some gcc option I can use that would allow me to 
>>>> determine
>>>> how many 'extra' registers would be necessary to allow my function 
>>>> to
>>>> run with zero spilling?
>>>
>>>
>>> Not really, no.  Solving it optimally is NP complete.
>>
>>
>> This actually doesn't appear to be true for all register interference 
>> graphs generated by GCC (and other compilers for that matter).
>> See "Register Allocation by Optimal Graph Coloring" for some 
>> statistics.
>> As I emailed Tim in private mail, I also tested this theory on all 
>> register interference graphs generated by GCC during bootstrap, make 
>> check, and compiling some random large programs i had.
>> They were all 1-perfect as well.
>>
>  Even if you can solve optimaly graph colouring problem, it is 
> probably not what Tim asked.

Tim wants to know the minimal number of registers to color his graph.
That is exactly the problem that is easy to solve on 1-perfect graphs.
>

As for the rest, i'm quite aware of various problems in register 
allocation, how gcc allocates registers, and what the hard problems in 
register allocation are.  I've spent way too much of my life involved 
in register allocation.
--Dan




More information about the Gcc mailing list