This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vectorizing HIRLAM 4: complicated access patterns examined.





This one gets vectorized for me, on powerpc-linux:

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

hilaram4.f90:4: note: Alignment of access forced using peeling.
hilaram4.f90:4: note: Vectorizing an unaligned access.
hilaram4.f90:4: note: LOOP VECTORIZED.
hilaram4.f90:7: note: vectorized 1 loops in function.

dorit


> L.S.,
>
> This code:
>
>       SUBROUTINE S(N)
>       DIMENSION A(N), B(N)
>       READ*,ISTART,ISTOP,B
>       DO I = ISTART, ISTOP
>          A(I) = B(I)
>       ENDDO
>       PRINT*,A
>       END
>
> when compiled thusly:
>
> $ gfortran -g -S -O3 -ftree-vectorize -ftree-vectorizer-verbose=2 -
> msse2 vect4.f
>
> draws the following "not vectorized" message:
>
> vect4.f:4: note: not vectorized: complicated access pattern.
> vect4.f:4: note: vectorized 0 loops in function.
>
> This sort of coding is rather prevalent in HIRLAM, especially in the
> interesting inner loops.  One needs this when not all of the inner area
> is accessible / computable by the code at hand (for instance because
there
> are inaccessible "halo's" around the subarea that have to be treated
> specially).
>
> The funny thing is that replacing ISTART with a constant makes this loop
> vectorizable.  So what's the fundamental difference (as far as
vectorizing
> is concerned) between a constant and a loop invariant :-) ?
>
> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]