This is the mail archive of the gcc-patches@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: [PING] Move costs, allocno costs, and per-register costs


Hi Vlad,

Thanks for the message.

Vladimir Makarov <vmakarov@redhat.com> writes:
> Richard Sandiford wrote:
>> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg00325.html
>> Fixes a problem with the costs of union classes.  Needed to fix
>> MIPS dspr2-MULT{,U}.c regressions.
>>
>>   
>   Sorry, Richard.  I missed that email.  I had some problems with my 
> email (an still messages for some time is  lost).
>
>   You did a big job comparing  so many targets.  I know about the 
> problem.  Recently  I tried to modify IRA (Chaitin-Briggs algorithm) to 
> permit allocnos to be of union of cover classes.  It could solve the 
> problem you are trying to solve by using smaller cover classes.  It also 
> could solve one IRA drawback in comparison with the old RA.  
> Memory-memory movements (like arr[i] = arr [j]) are implemented usually 
> as  two insns using a temporary  register.  The  temporary register 
> could be  of two cover classes (e.g. general purpose or float regs).  

Yes, this would solve the problem in the case I'm seeing, in that it
would be natural to treat GR_REGS and ACC_REGS as separate cover classes.
But would you get rid of the "preferred class" code at the same time?
If not, I think the underlying problem would still be there.

To put it another way: having a single cover class is a fairly important
characteristic of the new RA.  On the other hand, I don't think the
problem I'm fixing _is_ a fundamental characteristic.  It seems to me
that IRA is simply internally inconsistent in its handling of certain
costs.  The inconsistency isn't fundamental to the algorithm or the
implementation: it seems to be more unintentional than anything.

Specifically, one part of IRA says that if A and B have cost X,
A union B also has cost X.  But this deduction (which is borrowed
from the old RA, correctly IMO) isn't transmitted to the code that
sets ALLOCNO_COVER_CLASS_COST to the cost of A union B.

Richard


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