Handle SLP permutations for variable-length vectors
commit66697aaede2edd7729979b7abe3c5e6967709c12
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Aug 2018 13:05:36 +0000 (24 13:05 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Aug 2018 13:05:36 +0000 (24 13:05 +0000)
treec666f7a31ae111b41e904e26bb4df9009c6db203
parent217cd82aec51e0a31d9fc810e0c0b2df38781f9e
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263832 138bc75d-0d04-0410-961f-82ee72b054a4
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