This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Vectorizing HIRLAM 1: This dependence is determinable.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: fortran at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Fri, 21 Oct 2005 15:12:20 +0200
- Subject: Vectorizing HIRLAM 1: This dependence is determinable.
L.S.,
This code:
SUBROUTINE S(N, M)
DIMENSION A(N, M), B(N, M)
READ*,A,B
DO J = 1, M
DO I = 1, N
A(I, J) = A(I, J) + B(I, J)
ENDDO
ENDDO
PRINT*,A
END
when compiled thusly:
$ gfortran -g -S -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -msse2 vect1.f
draws the following "not vectorized" message:
vect1.f:5: note: not vectorized: can't determine dependence between (*a_23)[D.951_86] and (*a_23)[D.951_86]
vect1.f:5: note: vectorized 0 loops in function.
That's pretty silly, of course :-)
Source and destination A(I,J) overlap exactly, so vectorization of this loop
is certainly possible. The equivalent rank-1 example is vectorized without
problems.
Exempting this one special case from "can't determine dependence" will mean
about 1000 more vectorized loops in HIRLAM.
Kind regards,
--
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/