This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Fortran array slices and -frepack-arrays
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: nd <nd at arm dot com>
- Date: Fri, 13 Apr 2018 14:32:29 +0000
- Subject: Fortran array slices and -frepack-arrays
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Hi,
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?
Wilco