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

Nadav Rotem nrotem at apple.com
Tue Apr 1 15:21:12 PDT 2014


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.  

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




More information about the llvm-commits mailing list