This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Matrix Flattening and Transposing optimizations
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Toon Moene <toon at moene dot indiv dot nluug dot nl>, Richard Guenther <richard dot guenther at gmail dot com>, Diego Novillo <dnovillo at redhat dot com>, Razya Ladelsky <RAZYA at il dot ibm dot com>, dberlin at dberlin dot org, Jan Hubicka <jh at suse dot cz>
- Date: Sun, 29 Apr 2007 15:10:08 +0200
- Subject: Re: [PATCH] Matrix Flattening and Transposing optimizations
- References: <OF9CBC5D0A.D8708AF3-ONC22572A9.002E67DB-C22572A9.003E36C4@il.ibm.com> <84fc9c000704281343n4fa37810j571f3f9311523732@mail.gmail.com> <46349792.4000005@moene.indiv.nluug.nl>
On Sunday 29 April 2007 15:03, Toon Moene wrote:
> >> 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:
You misunderstood, Richard's question was rhetorical. Yes, this is
*exactly* what the -ftree-loop-linear option is for.
The fact that it apparently does not work for this test case is
something else. You could take a look at the "ltrans"-dump to see
why the linear loop transformations does not perform loop interchange.
I hope the matrix flattening transformation does not perform this
optimization. The linear loop transformations framework is much more
generally applicable. It needs TLC, going by the Bugzilla bug count,
but it still has great potential.
Gr.
Steven