Handle SLP permutations for variable-length vectors
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 24 Aug 2018 13:05:36 +0000 (13:05 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 24 Aug 2018 13:05:36 +0000 (13:05 +0000)
commitab7e60cec1a6f4185b0428f3a2b3e71df0bae533
treec666f7a31ae111b41e904e26bb4df9009c6db203
parent1ade64c9d8cd37c8db0a07383189f1719c7164da
Handle SLP permutations for variable-length vectors

The SLP code currently punts for all variable-length permutes.
This patch makes it handle the easy case of N->N permutes in which
the number of vector lanes is a multiple of N.  Every permute then
uses the same mask, and that mask repeats (with a stride) every
N elements.

The patch uses the same path for constant-length vectors,
since it should be slightly cheaper in terms of compile time.

2018-08-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-slp.c (vect_transform_slp_perm_load): Separate out
the case in which the permute needs only a single element and
repeats for every vector of the result.  Extend that case to
handle variable-length vectors.
* tree-vect-stmts.c (vectorizable_load): Update accordingly.

gcc/testsuite/
* gcc.target/aarch64/sve/slp_perm_1.c: New test.
* gcc.target/aarch64/sve/slp_perm_2.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_3.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_4.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_5.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_6.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_7.c: Likewise.

From-SVN: r263832
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/slp_perm_7.c [new file with mode: 0644]
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c