This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS: 2'nd pass of ira, causes weird register allocation for 2-op mult


Hi Vlad,

Thanks for the answer.

Vladimir Makarov <vmakarov@redhat.com> writes:
> On 05/28/2012 03:09 PM, Richard Sandiford wrote:
>>    Or is it a conceptual part of the algorithm?
> No.
>>    More generally,
>> what kind of situations does the second pass help with?
> I can not show such situations right now but I did some benchmarking 
> long ago on the old RA and the second pass is really important for 
> better code generation.  That time I even thought about 3rd pass for 
> -O3.  I don't think the situation is now different.
>
> Cost pass is a complicated part.  It is impossible to find some good 
> literature which could help.  The problem is in GCC compiler specifics 
> when code selection is not done (at least fully) before RA and we don't 
> know until reload end what  alternative will be used.  So some code 
> selection is done in combiner, some in IRA (including cost pass by 
> defining allocation classes for pseudos) and final code selection is 
> done in reload.

Understood.  But I wasn't sure what the second pass was actually trying
to do, or more specifically, how it was expected to give different
results from the first pass.  Most other parts of IRA are well commented
and describe what the code is trying to do (with as you say the usual
caveat that this is always going to be a heuristic, and may not be taken
directly from the literature).  But I couldn't see a similar comment
describing how the second pass worked and what it was trying to do.

I'd be happy to add one myself, but I haven't worked it out yet :-)

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]