This is the mail archive of the
mailing list for the GCC project.
Re: MIPS: 2'nd pass of ira, causes weird register allocation for 2-op mult
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: Klaus Pedersen <projectu at gmail dot com>, gcc at gnu dot org
- Date: Tue, 29 May 2012 07:33:50 +0100
- Subject: Re: MIPS: 2'nd pass of ira, causes weird register allocation for 2-op mult
- References: <CANbV6W==XSF_kjhbikAkyNy8WCMy29ScWoUcnH35FnJaqemail@example.com> <firstname.lastname@example.org> <4FC40268.email@example.com>
Thanks for the answer.
Vladimir Makarov <firstname.lastname@example.org> writes:
> On 05/28/2012 03:09 PM, Richard Sandiford wrote:
>> Or is it a conceptual part of the algorithm?
>> 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 :-)