http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50789
--- Comment #12 from rguenther at suse dot de <rguenther at suse dot de> 2013-04-17 08:53:21 UTC --- On Wed, 17 Apr 2013, andrey.turetskiy at gmail dot com wrote: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50789 > > Andrey Turetskiy <andrey.turetskiy at gmail dot com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |andrey.turetskiy at gmail > | |dot com > > --- Comment #11 from Andrey Turetskiy <andrey.turetskiy at gmail dot com> > 2013-04-17 08:31:29 UTC --- > It looks like gathers can be used for vectorization in cases like: > > #define N 1024 > > float x[4*N], y[N]; > > void foo () > { > int i; > for (i = 0; i < N; i++) > y[i] = x[179 + 3*i]; > } > > Now this code isn't vectorized. > In addition there are a lot of such exampes in SPECS 2006. Vectorization with > gathers can give noticeable gain. The above can be vectorized with the strided-load vectorization support (just it doesn't trigger here). And strided-load vectorization code-generation can be imrpoved by using gather vectorization by first building a vector of addresses / indices and then performing a gather load. If building a vector of addresses / indices is cheaper than performing scalar loads and building a vector from the results, that is. So the above is more related to strided load support (and the not yet implemented strided store support as well, if there are also gather stores ...) Richard.