patches for increased performance of matmul, dotprod, transpose

Tim Prince tprince@myrealbox.com
Tue Sep 13 05:37:00 GMT 2005


Tim Prince wrote:

> Tobias Schlüter wrote:
>
>> Tim Prince wrote:
>>  
>>
>>> Performance of Livermore Fortran Kernels 3 and 21 on Pentium D 
>>> x86-64 exceeds ifort with these patches.  Performance of Kernel 4 is 
>>> doubled from previous libgfortran, and Kernel 6 is speeded up 
>>> significantly.  This assumes those kernels are written using 
>>> dotprod() and matmul().
>>> I verified performance gain also on ia64 linux and Pentium-m cygwin.
>>>   
>>
>>
>> This looks fairly convincing.  Have you opened optimizer bugs for 
>> these issues?
>>
>>  
>>
>>> *************** sinclude(`matmul_asm_'rtype_code`.m4')dn
>>> *** 188,191 ****
>>> --- 187,191 ----
>>>          for (x = 0; x < xcount; x++)
>>>            dest[x + y*rystride] = (rtype_name)0;
>>> +     /* Possible FIXME:  original code does not surround * by 
>>> spaces.  */
>>>      }
>>>   
>>
>>
>> You're free to fix such issues in your patch ...
>>
>>  
>>
>>> --- 194,220 ----
>>>        bbase_y = bbase + y*bystride;
>>>        dest_y = dest + y*rystride;
>>> !       for (x = 0; x < xcount-1; x += 2)
>>>   
>>
>>                                ^
>> ... but you shouldn't introduce them yourself.
>>
>> libgfortran is not very strict in its adherence to the coding style, 
>> but don't
>> let its bad example fool you.
>>
>> Is anybody opposed to applying Tim's patch?  From my point of view 
>> it's ok.
>>
>> - Tobi
>>
>>  
>>
> The latest gcc-4.1 performs strength reduction on all of these index 
> calculations, so I could simplify the patch.
>
No, on ia64, matmul has serious performance degradation from missed 
strength reduction, both with gcc-4.0.2 and 4.1.0.  I don't think the 
work-around for ia64 should be included in matmul.m4.



More information about the Fortran mailing list