This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/14741] graphite with loop blocking and interchanging doesn't optimize a matrix multiplication loop
- From: "spop at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Jul 2013 21:59:21 +0000
- Subject: [Bug tree-optimization/14741] graphite with loop blocking and interchanging doesn't optimize a matrix multiplication loop
- Auto-submitted: auto-generated
- References: <bug-14741-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14741
--- Comment #25 from Sebastian Pop <spop at gcc dot gnu.org> ---
I think the linearization of array subscripts problem is linked to passing
arguments to a function in Fortran: by inlining the mult function call in the
main program, the main loop on C(I,J)=C(I,J)+A(I,K)*B(K,J) is blocked as well
$ gfortran -ffast-math -O3 -floop-nest-optimize tt.f90 -fdump-tree-graphite-all
$ cat tt.f90
INTEGER, PARAMETER :: N=1024
REAL*8 :: A(N,N), B(N,N), C(N,N)
REAL*8 :: t1,t2
INTEGER :: I,J,K
A=0.1D0
B=0.1D0
C=0.0D0
CALL cpu_time(t1)
DO J=1,N
DO I=1,N
DO K=1,N
C(I,J)=C(I,J)+A(I,K)*B(K,J)
ENDDO
ENDDO
ENDDO
CALL cpu_time(t2)
write(6,*) t2-t1,C(1,1)
END