Improve the analysis of loop interchange

Daniel Berlin dberlin@dberlin.org
Wed Mar 14 18:13:00 GMT 2007


Okay

On 3/14/07, Sebastian Pop <sebastian.pop@inria.fr> wrote:
> Hi,
>
> Here is a patch that corrects the analysis of strides for the
> loop interchange.  We used to not transform loops like the
> one from the testcase ltrans-5.c with multidimensional data:
>
> int A[100][1111];
>
> for( i = 0; i < 1111; i++)
>   for( j = 0; j < 100; j++)
>     A[j][i] = 5 * A[j][i];
>
> The strides are collected in each dimension, for instance in
> this testcase we collected the evolution in loop_i from A[j][i]
> is 2 (there are two references with strides of 1), and the
> evolution in loop_j from A[j][i] was wrongly computed equal
> to 2, as the strides in the array A are of size of a line, not just
> of 1.
>
> With this patch we collect the strides for loop_j 2222 for A[j][i],
> and we realize that this is bigger than 200 for loop_i, such that we
> trigger the interchange transform for having smaller strides that are
> better for cache locality.
>
> Bootstrapped and tested on amd64-linux.  Okay for trunk?
>
> Sebastian
>
>



More information about the Gcc-patches mailing list