This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, vectorizer] Fix tree-optimization/PR 37474 - bug in loop aware SLP analysis


On Thu, Sep 11, 2008 at 1:09 PM, Ira Rosen <IRAR@il.ibm.com> wrote:
>
> Hi,
>
> This patch adds a missing check that the size of load permutation in
> loop-aware SLP is square SLP group size (we only support load permutations,
> where the number of different loads is equal to the group size and each
> such load appears group size times).
>
> Bootstrapped with vectorization enabled and now testing on x86_64-linux.
> O.K. for mainline once the testing completes?

Ok.

Thanks,
Richard.

> Thanks,
> Ira
>
>
> ChangeLog:
>
>      PR tree-optimization/37474
>      * tree-vect-analyze.c (vect_supported_load_permutation_p): Check the
> length.
>      of load permutation.
>
> testsuite/ChangeLog:.
>
>      PR tree-optimization/37474
>      * gcc.dg/vect/pr37474.c: New test.
>
> Index: tree-vect-analyze.c
> ===================================================================
> --- tree-vect-analyze.c (revision 140274)
> +++ tree-vect-analyze.c (working copy)
> @@ -3200,6 +3200,10 @@ vect_supported_load_permutation_p (slp_i
>   /* FORNOW: the only supported permutation is 0..01..1.. of length equal
> to
>      GROUP_SIZE and where each sequence of same drs is of GROUP_SIZE
> length as
>      well.  */
> +  if (VEC_length (int, load_permutation)
> +      != (unsigned int) (group_size * group_size))
> +    return false;
> +
>   supported = true;
>   for (j = 0; j < group_size; j++)
>     {
>
> Index: testsuite/gcc.dg/vect/pr37474.c
> ===================================================================
> --- testsuite/gcc.dg/vect/pr37474.c     (revision 0)
> +++ testsuite/gcc.dg/vect/pr37474.c     (revision 0)
> @@ -0,0 +1,38 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target vect_int } */
> +
> +#include <stdarg.h>
> +
> +#define M00 100
> +#define M10 216
> +#define M01 1322.
> +#define M11 13
> +#define M02 74
> +#define M12 191
> +
> +#define N 16
> +
> +void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__
> pOutput)
> +{
> +  unsigned int i, a, b, c, d, e, f;
> +
> +  for (i = 0; i < N / 3; i++)
> +    {
> +       a = *pInput++;
> +       b = *pInput++;
> +       c = *pInput++;
> +       d = *pInput++;
> +       e = *pInput++;
> +       f = *pInput++;
> +
> +       a = a + d;
> +       b = b + e;
> +       c = c + f;
> +
> +       *pOutput++ = M00 * a + M01 * b + M02 * c;
> +       *pOutput++ = M10 * a + M11 * b + M12 * c;
> +    }
> +}
> +}
> +/* { dg-final { cleanup-tree-dump "vect" } } */;
> +
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]