diff options
author | Richard Biener <rguenther@suse.de> | 2015-05-04 14:24:49 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-05-04 14:24:49 +0000 |
commit | 78a8b26c40f8be8eaca5aaa2680e213e0bd7d05a (patch) | |
tree | 9ef0826a52ad6fa9d58f2d6a4b69cfa220f5f9f5 | |
parent | 7457466941a2a06b99731bb7ed3ab90ba37b8110 (diff) | |
download | gcc-78a8b26c40f8be8eaca5aaa2680e213e0bd7d05a.zip gcc-78a8b26c40f8be8eaca5aaa2680e213e0bd7d05a.tar.gz gcc-78a8b26c40f8be8eaca5aaa2680e213e0bd7d05a.tar.bz2 |
re PR middle-end/65965 (Straight-line memcpy/memset not vectorized when equivalent loop is)
2015-05-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/65965
* tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Split
store groups at gaps.
* gcc.dg/vect/bb-slp-33.c: New testcase.
From-SVN: r222765
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/bb-slp-33.c | 49 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 9 |
4 files changed, 69 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ba7b94..756071d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2015-05-04 Richard Biener <rguenther@suse.de> + PR tree-optimization/65965 + * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Split + store groups at gaps. + +2015-05-04 Richard Biener <rguenther@suse.de> + PR tree-optimization/65935 * tree-vect-slp.c (vect_build_slp_tree): If we swapped operands then make sure to apply that swapping to the IL. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 719e013..5830818 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2015-05-04 Richard Biener <rguenther@suse.de> + PR tree-optimization/65965 + * gcc.dg/vect/bb-slp-33.c: New testcase. + +2015-05-04 Richard Biener <rguenther@suse.de> + PR tree-optimization/65935 * gcc.dg/vect/bb-slp-pr65935.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-33.c b/gcc/testsuite/gcc.dg/vect/bb-slp-33.c new file mode 100644 index 0000000..4e84f51 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-33.c @@ -0,0 +1,49 @@ +/* { dg-require-effective-target vect_int } */ + +#include "tree-vect.h" + +extern void abort (void); + +void __attribute__((noinline,noclone)) +test(int *__restrict__ a, int *__restrict__ b) +{ + a[0] = b[0]; + a[1] = b[1]; + a[2] = b[2]; + a[3] = b[3]; + a[5] = 0; + a[6] = 0; + a[7] = 0; + a[8] = 0; +} + +int main() +{ + int a[9]; + int b[4]; + b[0] = 1; + __asm__ volatile (""); + b[1] = 2; + __asm__ volatile (""); + b[2] = 3; + __asm__ volatile (""); + b[3] = 4; + __asm__ volatile (""); + a[4] = 7; + check_vect (); + test(a, b); + if (a[0] != 1 + || a[1] != 2 + || a[2] != 3 + || a[3] != 4 + || a[4] != 7 + || a[5] != 0 + || a[6] != 0 + || a[7] != 0 + || a[8] != 0) + abort (); + return 0; +} + +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "slp2" { target { vect_element_align || vect_hw_misalign } } } } */ +/* { dg-final { cleanup-tree-dump "slp2" } } */ diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 96afc7a..ccb1f62 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -2602,6 +2602,15 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) if ((init_b - init_a) % type_size_a != 0) break; + /* If we have a store, the accesses are adjacent. This splits + groups into chunks we support (we don't support vectorization + of stores with gaps). */ + if (!DR_IS_READ (dra) + && (init_b - (HOST_WIDE_INT) TREE_INT_CST_LOW + (DR_INIT (datarefs_copy[i-1])) + != type_size_a)) + break; + /* The step (if not zero) is greater than the difference between data-refs' inits. This splits groups into suitable sizes. */ HOST_WIDE_INT step = tree_to_shwi (DR_STEP (dra)); |