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

Sebastian Pop spop at codeaurora.org
Fri Oct 11 07:27:55 PDT 2013


Hi Arnold and Tobi,

Tobias Grosser wrote:
> On 10/10/2013 11:41 PM, Arnold Schwaighofer wrote:
> >if (n < umax(i4)/4) {
> >   // vectorized loop. perform math in scev with assumption that "{0,+,4}<%for.cond1.preheader> < umax(i4)/4?.
> >} else
> >   // scalar loop
> >
> > I think, for all this to work we would need some framework on top of/within
> > scev that enables us to ?work with SCEV under the assumption X?. This would
> > be useful for other things (e.g. getting rid of z/sexts in scev expressions,
> > etc http://llvm.org/bugs/show_bug.cgi?id=16358, which in term simplifies
> > dependence testers based on scev).

Because SCEV analyzes the original code (before versioning), SCEV should report
a conservative expression not assuming any extra constraints (as it does today.)

SCEV could collect the constraints under which it can compute a simpler
expression. Then we could decide to add these constraints to our versioning
decision and perform an "instantiation" of the SCEVs under these assumptions.

If the analyzed code contains assumptions (asserts, conditions, loop bounds) and
do not require versioning, SCEV should use all these assumptions.

> Yes, this seems the right approach. I remember HAL's pass provided
> with the delinearization a set of conditions that had to hold for
> this delinearization to be valid. In most cases we probably do not
> observe wrapping so assuming it does not happen and adding run-time
> checks in case it does seems to be the right approach.

Right.

Thanks for your feedback!
Sebastian
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation



More information about the llvm-commits mailing list