RFA: patch to solve PR37535

Jeff Law law@redhat.com
Tue Sep 23 20:46:00 GMT 2008


Vladimir Makarov wrote:
> Richard Sandiford wrote:
>>
>> I suppose it all boils down to: is an _unmatched_ (clobber (reg X))
>> an output clobber or an early clobber?  Because it's unmatched, there
>> are no constraints to tell us which.
>>
>>   
> Ok.  I think my patch is better then.  Because if there is no one 
> early clobber insn alternative, the patch permits to use clobber hard 
> reg for input operands in RA (the code would better although to be 
> honest I did not see the difference out of noise when I tested my 
> patch on SPEC2000 on x86 but the code size is insignificantly 
> smaller).  So instead of your patch, we could
>
> 1. use my patch and
> 2. modify the documentation to something like that
>
>    When a @code{clobber} expression for a register appears inside a
>    @code{parallel} with other side effects and there is a early clobber
>    constraint alternative for the clobbered operand, the register 
> allocator
>    guarantees that the register is unoccupied both before and after that
>    insn.
So I think what we're trying to do with the documentation fix is 
separate out a "naked" clobber from one which appears within an insn, 
right?
>
> I've checked how the old RA deals with this problem (file 
> ra-conflicts.c).  It seems to me that it uses the same approach as my 
> patch.  The code in ra-conflicts.c is trying to be even more accurate 
> because it tries to reject more alternative with earlier clobber.  
> Although I think it does not have to be such accurate as I mentioned 
> in SPEC2000 performance testing.  Another my observation, for *most* 
> insns with early clobber each alternative contains early clobber mark 
> (&) although there are some exceptions.
Yea, it's marginally better from an allocation standpoint if we can pick 
an alternative that doesn't early clobber as we can have the clobber 
co-exist with the inputs.  However, it's also been my experience through 
the years that:

  1. Most clobbers are early clobbers.

  2. Many which are not early clobbers should be early clobbers :(

  3. Tracking down bugs associated with #2 is a PITA.

I'm not going to lose any sleep if we lose this tiny bit of optimization 
in our handling of clobbers.

Jeff



More information about the Gcc-patches mailing list