This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [PATCH] PR fortran/31593: Speed up loops with DO variables as procedure arguments



Hi Dominique,


Dominique Dhumieres wrote:
Here are the timings for capacita.f90 (unpatched, patched, and without
the call to gfc_trans_simple_do:

[ibook-dhum] lin/test% gfc -m64 -O3 -ffast-math -funroll-loops -fomit-frame-pointer capacita.f90
[ibook-dhum] lin/test% time a.out > /dev/null
49.467u 1.360s 0:51.08 99.4%	0+0k 0+0io 39pf+0w
[ibook-dhum] lin/test% time a.out > /dev/null
49.724u 1.348s 0:51.23 99.6%	0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% /Volumes/MacBook/opt/gcc/gcc4.5w-0/bin/gfortran  -m64 -O3 -ffast-math -funroll-loops -fomit-frame-pointer capacita.f90
[ibook-dhum] lin/test% time a.out > /dev/null
53.174u 1.380s 0:54.74 99.6%	0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% time a.out > /dev/null
53.273u 1.377s 0:54.83 99.6%	0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% /Volumes/MacBook/opt/gcc/gcc4.5w-do/bin/gfortran -m64 -O3 -ffast-math -funroll-loops -fomit-frame-pointer capacita.f90
[ibook-dhum] lin/test% time a.out > /dev/null
48.640u 1.356s 0:50.16 99.6%	0+0k 0+0io 0pf+0w
[ibook-dhum] lin/test% time a.out > /dev/null
48.732u 1.366s 0:50.26 99.6%	0+0k 0+0io 0pf+0w

so it is ~8% slower with your patch and ~2% faster without
the call to gfc_trans_simple_do.

The other way, gcc4.5w-0 was with the 'if (0 && ...' according to your other mail. I didn't expect the 2% speedup, but as we saw yesterday, escaping pointers can have very global effects. The 'if (0 &&' still lets pointers to loop variables escape, so any effects of my patch that are not local to the affected loop are not to be expected. That said, I've yet to understand why capacita.f90 loses so badly, its inner loop isn't complicated and therefore the optimizers should be able to handle it well even without gfc_trans_simple_do.


I'll revise my patch along the lines RTH suggested, and resubmit. The problem with air.f90 definitely lies somewhere else, and out of reach for me.

Cheers,
- Tobi
--
Tobias Schlüter
Am Coulombwall 1, Zi. 326
85748 Garching b. München
Tel.: +49/89/289-14139


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