From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16982 invoked by alias); 21 Jul 2013 22:01:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14458 invoked by uid 48); 21 Jul 2013 21:59:25 -0000 From: "spop at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/14741] graphite with loop blocking and interchanging doesn't optimize a matrix multiplication loop Date: Sun, 21 Jul 2013 22:01:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: tree-ssa X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: spop at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-07/txt/msg00967.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14741 --- Comment #25 from Sebastian Pop --- 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