This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] Matrix Flattening and Transposing optimizations


Richard Guenther wrote:

On 4/28/07, I wrote:

Razya, does your patch does the right thing to reorder:

       SUBROUTINE SUB(A, B, N, M)
       DIMENSION A(N, M), B(N, M)
       DO I = 1, N
          DO J = 1, M
             A(I, J) = B(I, J)
          ENDDO
       ENDDO
       END

Currently, it doesn't vectorize because the loops are not in the right
order.  Note that you don't have to "reorganize the matrix [layout]" to
get this right - just reorder the loops.

Isn't that what -ftree-loop-linear is for?

Apparently not:


$ /usr/snp/bin/gfortran -S -g -O2 -ftree-vectorize -ftree-vectorizer-verbose=2 -ftree-loop-linear vect6.f

vect6.f:4: note: not vectorized: unhandled data-ref
vect6.f:1: note: vectorized 0 loops in function.

$ /usr/snp/bin/gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../trunk/configure --prefix=/usr/snp/ --disable-multilib --disable-nls --enable-languages=fortran
Thread model: posix
gcc version 4.3.0 20070428 (experimental)


--
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
At home: http://moene.indiv.nluug.nl/~toon/
Who's working on GNU Fortran: http://gcc.gnu.org/ml/gcc/2007-01/msg00059.html



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