[llvm-commits] Reassociating for vectors

Hal Finkel hfinkel at anl.gov
Sat May 26 06:13:07 PDT 2012


On Sat, 26 May 2012 00:06:29 -0700
Andrew Trick <atrick at apple.com> wrote:

> On May 25, 2012, at 7:38 PM, Hal Finkel wrote:
> > This interests me because I also need some procedure for
> > reassociating in order to have basic-block vectorization do
> > something interesting for reductions. To start, I'd want
> > a+b+c+d+e+f+g+h, regardless of the original association, to be
> > transformed into: (a+b)+(c+d)+(e+f)+(g+h) or (a+b+c+d)+(e+f+g+h)
> > [the number of groups should depend on the target's vector length,
> > and maybe some other things as well].
> > 
> > I'm not sure whether I should try to bake this into Reassociate, or
> > refactor Reassociate so that parts of it can be used by
> > BBVectorize, or something else. Do you have an opinion?
> 
> This sounds to me like something BBVectorize should do only after
> determining the expression is vectorizable.

It seems like, in general, such a transformation exposes
ILP, and that would be good even if the result did not vectorize. Do
you think I'm wrong about that?

Thanks again,
Hal

> 
> -Andy



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list