[RFC PATCH, i386]: Autovectorize 8-byte vectors

Uros Bizjak ubizjak@gmail.com
Thu Jun 27 06:08:00 GMT 2019

On Thu, Jun 27, 2019 at 8:05 AM Jakub Jelinek <jakub@redhat.com> wrote:
> On Wed, Jun 26, 2019 at 12:19:28PM +0200, Uros Bizjak wrote:
> > Yes, the patch works OK. I'll regression test it and push it later today.
> I think it caused
> +FAIL: gcc.dg/tree-ssa/pr84512.c scan-tree-dump optimized "return 285;"
> which admittedly already is xfailed on various targets.
> We now newly vectorize those loops and there is no FRE or similar pass
> after vectorization to clean it up, in particular optimize the
> a[8] and a[9] loads given the MEM <vector(2) int> [(int *)&a + 32B]
> store:
>   MEM <vector(2) int> [(int *)&a + 32B] = { 64, 81 };
>   _13 = a[8];
>   res_6 = _13 + 140;
>   _18 = a[9];
>   res_15 = res_6 + _18;
>   a ={v} {CLOBBER};
>   return res_15;

Yes, I have seen pr84512.c, but the failure is benign. It is caused by
the fact that we now vectorize the loops of the test.

> Shall we xfail it, or is there a plan to enable FRE after vectorization,
> or similar pass that would be able to do similar memory optimizations?
> Note, the RTL passes are able to optimize it in the end in this testcase.

The testcase failure could be solved by -fno-tree-vectorize, but I
think that the value should be propagated through vectors, and tree
optimizers should optimize the vectorized function in the same way as
scalar function.


More information about the Gcc-patches mailing list