Fortran array slices and -frepack-arrays

Thomas Koenig tkoenig@netcologne.de
Wed Apr 18 20:28:00 GMT 2018


Hi Wilco,

> The vast majority of steps in array slices are 1, so it mostly adds extra
> code. The codesize cost on SPEC2017 is 2% on exchange2_r, 6.6% on
> roms_r (large number of array slices, so if function versioning is feasible
> then that is preferable) - the rest is either identical or ~0.2% larger.
> 
> I'll see whether I can run some more benchmarks.

There is a standard way to specify what -frepack-arrays does: Specify
the CONTIGUOUS attribute to the dummy argument.

You could also try using -flto (which should be able to deduce that
strides are equal to one), but LTO has some known issues with Fortran.

Regards

	Thomas



More information about the Fortran mailing list