This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] SLP vectorization of reductions
On Mon, Apr 19, 2010 at 2:11 AM, Ira Rosen <IRAR@il.ibm.com> wrote:
>
> Hi,
>
> Current loop-aware SLP originates from groups of adjacent (strided) stores.
> This patch adds an ability to start SLP from a group of reductions, such
> as:
>
> sum0 = 0;
> sum1 = 2;
> for (i = 0; i < n; i++)
> ?{
> ? ?sum0 += a[2*i];
> ? ?sum1 += a[2*i+1];
> ?}
>
> will be now vectorized using SLP:
> (assuming vectorization factor 4)
>
> vsum ?= {0,2,0,0}
> for (i = 0; i < n; i+=4)
> ?vsum += {a[4*i], a[4*i+1], a[4*i+2], a[4*i+3]};
>
> sum0 = vsum[0] + vsum[2];
> sum1 = vsum[1] + vsum[3];
>
>
> This patch fixes PR 37027.
>
>
> Bootstrapped on x86_64-suse-linux, tested on x86_64-suse-linux and
> powerpc64-suse-linux.
> Committed.
>
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43842
--
H.J.