[PATCH][RFC] Make parameter aliasing for Fortran more efficient
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Aug 6 17:21:00 GMT 2008
On Mon, Aug 04, 2008 at 05:57:17PM +0200, Richard Guenther wrote:
>
> Currently for parameters to Fortran functions we mark them aliasing only
> theirselves by creating a heap object which they point to
>
> PARM_NOALIAS.594 = &ESCAPED
> PARM_NOALIAS.594.196+196 = &ESCAPED
> self = &PARM_NOALIAS.594
>
> as you may notice that dereferencing self will lead to pointers pointing
> to global memory. This of course makes parameter aliasing quite
> uneffective for array descriptors, as the actual array data is just a
> pointer in the array descriptor data... which means the actual data
> just is in global memory and will use regular type tags.
>
> Now, the fix is easy - just pretend Fortran arguments transitively
> point to distinct memory by doing
>
> PARM_NOALIAS.594 = &PARM_NOALIAS.594
> self = &PARM_NOALIAS.594
>
> instead. This allows a whole bunch of optimizations in tonto at least.
>
> Bootstrap / regtest in progress. I'd appreciate some other Fortran
> benchmarking (and verification).
>
It doesn't appear to have much impact on the Polyhedron codes.
Each number below is the 'User time' from time(1) and is an
average of five consecutive runs. The command line options
for each compiler are
-w -O2 -pipe -march=native -funroll-loops -ftree-vectorize -static
The hardware is x86_64-unknown-freebsd8.0
gfortran 4.2.5 4.3.2 4.4.0 4.4.0
Patched Unpactched
---------------------------------------------
ac.f90 41.396 17.678 18.984 18.992
aermod.f90 44.768 45.634 46.856 46.822
air.f90 18.408 18.184 17.808 17.872
capacita.f90 104.29 101.99 107.094 111.324
channel.f90 13.24 13.266 12.936 13.02
doduc.f90 50.172 50.882 52.66 52.64
fatigue.f90 21.79 18.874 16.634 16.064
gas_dyn.f90 18.806 15.666 15.726 15.784
induct.f90 65.394 62.058 51.372 51.354
linpk.f90 28.952 28.932 29.442 28.996
mdbx.f90 22.208 21.72 21.68 21.73
nf.f90 191.464 190.306 192.356 186.272
protein.f90 61.196 61.584 64.918 64.89
rnflow.f90 52.07 50.532 50.98 50.864
test_fpu.f90 26.47 27.286 27.78 27.302
tfft.f90 9.122 9.024 9.082 9.31
If anything, there appear to be some regressions between
trunk and 4.3.2.
--
Steve
More information about the Fortran
mailing list