This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Vectorizing HIRLAM 2: One out of the "unhandled data-ref" garbage bin :-)
- 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:19:57 +0200
- Subject: Vectorizing HIRLAM 2: One out of the "unhandled data-ref" garbage bin :-)
L.S.,
This code:
SUBROUTINE S(A, B, N)
DIMENSION A(N), B(N)
READ*,Z,B
DO I = 1, N
A(I) = Z * B(I)
ENDDO
PRINT*,A
END
when compiled thusly:
$ gfortran -g -S -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -msse2 vect2.f
draws the following "not vectorized" message:
vect2.f:4: note: not vectorized: unhandled data-ref
vect2.f:4: note: vectorized 0 loops in function.
Hmmm, how about broadcasting Z to a vector register and using that in a
vectorized version of this loop :-) ?
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/