[PATCH] Enhance reload_cse_move2add

Jie Zhang jie@codesourcery.com
Mon Jul 12 08:09:00 GMT 2010


On 07/12/2010 03:17 PM, Steven Bosscher wrote:
> On Mon, Jul 12, 2010 at 9:10 AM, Jie Zhang<jie@codesourcery.com>  wrote:
>> On 07/10/2010 08:06 AM, Bernd Schmidt wrote:
>>>
>>> On 07/09/2010 06:58 PM, Jie Zhang wrote:
>>>>
>>>> I just tested idctrn01 on my pentium-m laptop. My patch does not change
>>>> the performance of idctrn01 on i386. I did some investigation. It's
>>>> because i386 can directly use "symbol_ref + offset" as the address in
>>>> load instructions. So there is no optimization opportunity that my patch
>>>> can utilize. That's the difference between RISC and CISC.
>>>
>>> [...]
>>>>
>>>> I collected the code size data from SPEC2000 on AMD64. My patch does not
>>>> change code size for any test whether -O2 or -O3, except
>>>>
>>>> Code Size
>>>> =========
>>>> Test  -O2        Before    After    Change
>>>> ----------------------------------------------
>>>> 172.mgrid        14962    14976        14
>>>>
>>>> Code Size
>>>> Test  -O3        Before    After    Change
>>>> ----------------------------------------------
>>>> 171.swim        19231    19247        16
>>>
>>> So what kinds of changes are there that would explain a 1.48% drop on
>>> 179.art?  If you can verify that the code is in fact identical, and the
>>> performance change is noise, the patch is ok.
>>>
>> I checked the disassemblies of all SPEC2000 tests. My patch generates
>> different code only for 171.swim, 172.mgrid and 173.applu whether with -O2
>> or -O3. It seems the noise can be as large as 1.48%.
>
> It can be much worse, depending on your machine configuration, cache,
> and whether the SPEC*CPU* test is actually memory-bound (like art,
> mcf, ammp, and a few others)...
>
Even I run it 5 iterations, it still can have noise like 179.art I got.

* 179: The 5 results for "Before" are 1013, 1023, 1004, 1012, 1016.
                 while for "After" are  993,  998,  998, 1009, 1005.

I'm lucky this time since the patch does not change the code. But if it 
changed the code, telling if it's noise or real regression would become 
much harder. I wonder how many iterations we have to use if we want to 
make sure the result can be trusted.


-- 
Jie Zhang
CodeSourcery



More information about the Gcc-patches mailing list