[Bug tree-optimization/14741] graphite with loop blocking and interchanging doesn't optimize a matrix multiplication loop

spop at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 29 22:16:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14741

--- Comment #28 from Sebastian Pop <spop at gcc dot gnu.org> ---
(In reply to Evgeniy Dushistov from comment #26)
> void mult(const double * const __restrict__ A, const double * const
> __restrict__ B, double * const __restrict__ C, const size_t N)
> {
> 	for (size_t j = 0; j < N; ++j)
> 		for (size_t i = 0; i < N; ++i)
> 			for (size_t k = 0; k < N; ++k)
> 				C[i * N + j] += A[i * N + k] + B[k * N + j];

This code has the same problem as the Fortran program: it has linearized memory
access functions.  This code won't be transformed by Graphite unless you
instantiate N with a compile time constant, or otherwise you'll have to
delinearize the array accesses, and we don't have code to do that yet.


More information about the Gcc-bugs mailing list