Fix SLP downward group access classification (PR92420)
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 11 Nov 2019 19:43:52 +0000 (19:43 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 11 Nov 2019 19:43:52 +0000 (19:43 +0000)
commit599bd99078439b9f11cb271aa919844318381ec5
tree43e915fe087ef94d41149983ad0b8fba1b8547ff
parent98aad294705ac35aec058e020867d736d841dad0
Fix SLP downward group access classification (PR92420)

This PR was caused by the SLP handling in get_group_load_store_type
returning VMAT_CONTIGUOUS rather than VMAT_CONTIGUOUS_REVERSE for
downward groups.

A more elaborate fix would be to try to combine the reverse permutation
into SLP_TREE_LOAD_PERMUTATION for loads, but that's really a follow-on
optimisation and not backport material.  It might also not necessarily
be a win, if the target supports (say) reversing and odd/even swaps
as independent permutes but doesn't recognise the combined form.

2019-11-11  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/92420
* tree-vect-stmts.c (get_negative_load_store_type): Move further
up file.
(get_group_load_store_type): Use it for reversed SLP accesses.

gcc/testsuite/
* gcc.dg/vect/pr92420.c: New test.

From-SVN: r278064
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr92420.c [new file with mode: 0644]
gcc/tree-vect-stmts.c