[llvm-commits] [PATCH] Multidimensional Array Index Delinearization Analysis

Preston Briggs preston.briggs at gmail.com
Tue Sep 25 12:09:04 PDT 2012


On Sun, Sep 23, 2012 at 9:57 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> I've attached an initial version of an analysis pass for
> delinearization of multidimensional array accesses. Specifically, this
> means the following:
>
> Given some function that looks like:
> void foo(long n, long m, long o, double A[n][m][o]) {
>   for (long i = 0; i < n; i++)
>     for (long j = 0; j < m; j++)
>       for (long k = 0; k < o; k++)
>         A[i][j][k] = 1.0;
> }
>
> The GEP instruction associated with the array access depends on the
> expression k + o*(j + m*i). From this expression, we recover:
>         size: o index: k
>         size: m index: j
>         size: 1 index: i
>
> In general, the index expression can be polynomials in both
> loop-dependent and loop-invariant variables, the sizes must be
> loop-invariant polynomials, and this pass attempts to handle these
> more-complicated expressions. Furthermore, the current implementation
> uses a specialized polynomial factoring algorithm, and so does not
> depend strongly on the form of the input expression.
>
> I would specifically like feedback on two issues (other comments, of
> course, are also welcome)       :
>
> 1. Do I need the custom polynomial class, or can I, and if so,
> should I, build the polynomial factoring on top of SCEV directly?

Since SCEVs offer a useful way to represent and manipulate
polynomials, I'd use 'em directly. There's already plenty of framework
in place to add, subtract, multiply, max, min, simplify, compare, etc.
I'd provide an entry point that takes a SCEV (a pair of SCEVs?) and
attempts to delinearize them.

What customers do we see for delinearization? Anything besides the
dependence analyzer and Polly?

I'd love to see comments.  Something long and introductory explaining
what you're doing and how. If you're working from a paper, tell us
about it; if not, compare and contrast with Maslov.

Preston



More information about the llvm-commits mailing list