On Sat, May 12, 2012 at 9:53 AM, Toon Moene <t...@moene.org> wrote: > On 05/11/2012 01:59 PM, Richard Guenther wrote: > >> This fixes the dependency of vectorization of strided loads on >> gather support. For that to work we need to lift the restriction >> in data-ref analysis that requries a constant DR_STEP. Fortunately >> fallout is small. > > > Would this also vectorize strided loops when the architecture doesn't have a > gather instruction ?
gather is different from strided loops. Gather is a[b[i]] while strided loops are for (i=0;; i+=stride) ...= a[i] with stride being non-constant. Your testcase requires gather support. Richard. > If so, it doesn't work for the attached case, which *does* vectorize with a > gather instruction: > > $ /tmp/c/bin/gfortran -g -O3 -ftree-vectorizer-verbose=2 -mavx2 -S > verintlin.f > > Analyzing loop at verintlin.f:68 > > Analyzing loop at verintlin.f:69 > > > Vectorizing loop at verintlin.f:69 > > 69: LOOP VECTORIZED. > verintlin.f:1: note: vectorized 1 loops in function. > > whereas: > > $ /tmp/c/bin/gfortran -g -O3 -ftree-vectorizer-verbose=2 -mavx -S > verintlin.f > > Analyzing loop at verintlin.f:68 > > Analyzing loop at verintlin.f:69 > > 69: not vectorized: not suitable for gather load D.2051_74 = > *parg_73(D)[D.2050_72]; > > 69: not vectorized: not suitable for gather load D.2051_74 = > *parg_73(D)[D.2050_72]; > > verintlin.f:1: note: vectorized 0 loops in function. > > -- > Toon Moene - e-mail: t...@moene.org - phone: +31 346 214290 > Saturnushof 14, 3738 XG Maartensdijk, The Netherlands > At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ > Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news