Fortran array slices and -frepack-arrays
Steve Kargl
sgk@troutmask.apl.washington.edu
Mon Apr 16 17:15:00 GMT 2018
On Mon, Apr 16, 2018 at 11:10:30AM +0000, Wilco Dijkstra wrote:
> Hi,
>
> I posted this on gcc-patches (https://gcc.gnu.org/ml/gcc/2018-04/msg00090.html) not realizing
> there is a dedicated Fortran list:
>
> I looked at a few performance anomalies between gfortran and Flang
> - it appears array slices are treated differently. Using -frepack-arrays
> fixed a performance issue in gfortran and didn't cause any regressions.
> Making input array slices contiguous helps both locality and enables
> more vectorization.
>
> So I wonder whether it should be made the default (-O3 or just -Ofast)?
> Alternatively would it be feasible in Fortran to version functions or
> loops if all arguments are contiguous slices?
The description of -frepack-arrays suggests that a temporary
array is created. What impact does this have on stack usage?
What impact does it have on code size? Other than some unnamed
code that you have, have you tried -frepack-arrays on say the
Polyhedron Benchmarks to investigate trade-offs with this
option.
--
Steve
More information about the Fortran
mailing list