Hi Toon,

Thanks for the testcases.

This one does get vectorized with autovect-branch:

 ~/autovect_cvs/bin/gfortran -O3 -ftree-vectorize -maltivec
-ftree-vectorizer-verbose=4 -S hilaram1.f90

hilaram1.f90:5: note: dependence distance  = 0.
hilaram1.f90:5: note: accesses have the same alignment.
hilaram1.f90:5: note: dependence distance modulo vf == 0 between
(*a_25)[D.949_60] and (*a_25)[D.949_60]
hilaram1.f90:5: note: Alignment of access forced using peeling.
hilaram1.f90:5: note: Vectorizing an unaligned access.
hilaram1.f90:5: note: LOOP VECTORIZED.
hilaram1.f90:9: note: vectorized 1 loops in function.

dorit

> 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: [EMAIL PROTECTED] - phone: +31 346 214290
> Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
> A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

Reply via email to