fix detection of negative step DR groups
authorRichard Biener <rguenther@suse.de>
Tue, 7 Jul 2020 11:57:40 +0000 (13:57 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 7 Jul 2020 14:09:21 +0000 (16:09 +0200)
commitf75211822f8d84bb706421d3692e6c1cdbdfc3a8
tree9a9dee5881ce201dd515b0036a850fc16f80b743
parente1b0956a8e1f5609266cbe064b345bbb37b1e7e2
fix detection of negative step DR groups

This fixes a condition that caused all negative step DR groups to
be detected as single element interleaving.  Such groups are
rejected by interleaving vectorization but miscompiled by SLP
which is fixed by forcing VMAT_STRIDED_SLP for now.

2020-07-07  Richard Biener  <rguenther@suse.de>

* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Fix
group overlap condition to allow negative step DR groups.
* tree-vect-stmts.c (get_group_load_store_type): For
multi element SLP groups force VMAT_STRIDED_SLP when the step
is negative.

* gcc.dg/vect/slp-47.c: New testcase.
* gcc.dg/vect/slp-48.c: Likewise.
gcc/testsuite/gcc.dg/vect/slp-47.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/slp-48.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c
gcc/tree-vect-stmts.c