[PATCH] [LoopVectorizer] Count dependencies of consecutive pointers as uniforms

Hal Finkel hfinkel at anl.gov
Tue Apr 1 19:46:00 PDT 2014



----- Original Message -----
> From: "Nadav Rotem" <nrotem at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "llvm-commits" <llvm-commits at cs.uiuc.edu>, "Arnold Schwaighofer" <aschwaighofer at apple.com>
> Sent: Tuesday, April 1, 2014 5:21:12 PM
> Subject: Re: [PATCH] [LoopVectorizer] Count dependencies of consecutive pointers as uniforms
> 
> 
> On Apr 1, 2014, at 2:49 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> > Hello,
> > 
> > For the purpose of calculating the cost of the loop at various
> > vectorization
> > factors, we need to count dependencies of consecutive pointers as
> > uniforms
> > (which means that the VF = 1 cost is used for all overall VF
> > values).
> 
> Yes.
> 
> > 
> > For example, the TSVC benchmark function s173 has:
> >  ...
> >  %3 = add nsw i64 %indvars.iv, 16000
> >  %arrayidx8 = getelementptr inbounds %struct.GlobalData*
> >  @global_data, i64 0, i32 0, i64 %3
> >  ...
> > and we must realize that the add will be a scalar in order to
> > correctly deduce
> > it to be profitable to vectorize this on PowerPC with VSX enabled.
> > In fact, it seems to me that all
> > dependencies of a consecutive pointer must be a scalar (uniform),
> > and so we
> > simply need to add all consecutive pointers to the worklist that
> > currently
> > detects collects uniforms.
> 
> LGTM. The only way to get a consecutive pointer is by performing
> pointer arithmetic on consecutive integers, which are stored as
> scalars.

r205387. Thanks!

 -Hal

> 
> > 
> > Fixes PR19296. Please review.
> > 
> > Thanks again,
> > Hal
> > 
> > --
> > Hal Finkel
> > Assistant Computational Scientist
> > Leadership Computing Facility
> > Argonne National Laboratory
> > <lv-unif.patch>
> 
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list