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

Andrew Trick atrick at apple.com
Wed Oct 3 10:44:09 PDT 2012


On Oct 3, 2012, at 12:20 AM, Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com> wrote:

> On Mon, 1 Oct 2012 10:32:46 -0700
> Andrew Trick <atrick at apple.com> wrote:
> 
>> Still, it would be worth attempting to solve this problem without a
>> separate polynomial package. I could imagine special-casing the
>> solution for the kind of nested recurrences that we expect to see. It
>> might also make sense to do the division "implicitly" without
>> attempting to create a SCEVUDiv expression. I think you're only
>> dealing with linear expressions of a fairly regular form. SCEV's
>> ability to canonicalize and unqiue expressions certainly helps. I
>> can't say for sure whether this will lead to a simpler
>> implementation, but I hope you consider it.
> 
> I think this is the correct way to go for the delinearizer. Note that
> the implicit division is already happening in the polynomial
> package ... it can instead be ported to produce SCEVs as the quotient
> and remainder.
> 
> Is the following statement a correct generalization of delinearization?
> 
>  (ab+c,+,as) = a*(b,+,s) + c
> 
> Note that we are not dividing the start by the step, but instead
> extracting a GCD from both sides along with a remainder from the
> start. Then `a' will be the co-efficient and `c' will be the quantity
> added to the index.
> 
> If this idea makes sense, what are the conditions for the 
> factorization to be correct?
> 
> In some sense, we are externally ``undoing'' the work done by the SCEV
> constructors when they push loop-invariant terms into the AddRec.

Yes, that's what I had in mind.
-Andy



More information about the llvm-commits mailing list