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


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


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