From: Richard Biener Date: Thu, 22 Oct 2015 13:33:17 +0000 (+0000) Subject: re PR tree-optimization/19049 (not vectorizing a fortran loop) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90a7a1b5b2c551158ccddbaad17d8b8021faa409;p=gcc.git re PR tree-optimization/19049 (not vectorizing a fortran loop) 2015-10-22 Richard Biener PR tree-optimization/19049 PR tree-optimization/65962 * tree-vect-data-refs.c (vect_analyze_group_access_1): Fall back to strided accesses if single-element interleaving doesn't work. * gcc.dg/vect/vect-strided-store-pr65962.c: New testcase. * gcc.dg/vect/vect-63.c: Adjust. * gcc.dg/vect/vect-70.c: Likewise. * gcc.dg/vect/vect-strided-u8-i2-gap.c: Likewise. * gcc.dg/vect/vect-strided-a-u8-i2-gap.c: Likewise. * gfortran.dg/vect/pr19049.f90: Likewise. * gfortran.dg/vect/vect-8.f90: Likewise. From-SVN: r229172 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 192360dc752..1e06d1a46ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-22 Richard Biener + + PR tree-optimization/19049 + PR tree-optimization/65962 + * tree-vect-data-refs.c (vect_analyze_group_access_1): Fall back + to strided accesses if single-element interleaving doesn't work. + 2015-10-22 Richard Biener PR middle-end/68046 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 45a287f3ec1..39260d6611c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2015-10-22 Richard Biener + + PR tree-optimization/19049 + PR tree-optimization/65962 + * gcc.dg/vect/vect-strided-store-pr65962.c: New testcase. + * gcc.dg/vect/vect-63.c: Adjust. + * gcc.dg/vect/vect-70.c: Likewise. + * gcc.dg/vect/vect-strided-u8-i2-gap.c: Likewise. + * gcc.dg/vect/vect-strided-a-u8-i2-gap.c: Likewise. + * gfortran.dg/vect/pr19049.f90: Likewise. + * gfortran.dg/vect/vect-8.f90: Likewise. + 2015-10-22 Richard Biener PR middle-end/68046 diff --git a/gcc/testsuite/gcc.dg/vect/vect-63.c b/gcc/testsuite/gcc.dg/vect/vect-63.c index 1afbd74b1d4..8d002a5e3c3 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-63.c +++ b/gcc/testsuite/gcc.dg/vect/vect-63.c @@ -13,7 +13,7 @@ int main1 () int ia[N*2][4][N]; /* Multidimensional array. Aligned. - The first dimension depends on j: not vectorizable. */ + The first dimension depends on j: use strided stores. */ for (i = 0; i < N; i++) { for (j = 0; j < N; j++) @@ -42,4 +42,4 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-70.c b/gcc/testsuite/gcc.dg/vect/vect-70.c index a94140ecabc..0ec06a273df 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-70.c +++ b/gcc/testsuite/gcc.dg/vect/vect-70.c @@ -37,7 +37,7 @@ int main1 () abort (); } - /* not consecutive */ + /* not consecutive, will use strided stores */ for (i = 0; i < N; i++) for (j = 3; j < N-3; j++) { @@ -62,7 +62,7 @@ int main (void) return main1 (); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" {target { vector_alignment_reachable} } } } */ /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" {target {{! vector_alignment_reachable} && {! vect_hw_misalign} } } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c index bb983b19dda..52fdcf6ee7d 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-a-u8-i2-gap.c @@ -44,7 +44,7 @@ main1 () } ptr = arr; - /* Not vectorizable: gap in store. */ + /* gap in store, use strided stores */ for (i = 0; i < N; i++) { res[i].a = ptr->b; @@ -71,5 +71,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_strided2 } } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c index fcbf2cc8c9f..8c541fe44a4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c +++ b/gcc/testsuite/gcc.dg/vect/vect-strided-u8-i2-gap.c @@ -35,7 +35,7 @@ main1 (s *arr) } ptr = arr; - /* Not vectorizable: gap in store. */ + /* gap in store, use strided stores. */ for (i = 0; i < N; i++) { res[i].a = ptr->b; @@ -73,5 +73,5 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided2 } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target vect_strided2 } } } */ diff --git a/gcc/testsuite/gfortran.dg/vect/pr19049.f90 b/gcc/testsuite/gfortran.dg/vect/pr19049.f90 index 5f4b9b15c3d..5e4a8da36b0 100644 --- a/gcc/testsuite/gfortran.dg/vect/pr19049.f90 +++ b/gcc/testsuite/gfortran.dg/vect/pr19049.f90 @@ -18,7 +18,4 @@ subroutine s111 (ntimes,ld,n,ctime,dtime,a,b,c,d,e,aa,bb,cc) return end -! { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } -! { dg-final { scan-tree-dump-times "complicated access pattern" 1 "vect" { xfail vect_multiple_sizes } } } -! { dg-final { scan-tree-dump-times "complicated access pattern" 2 "vect" { target vect_multiple_sizes } } } - +! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } diff --git a/gcc/testsuite/gfortran.dg/vect/vect-8.f90 b/gcc/testsuite/gfortran.dg/vect/vect-8.f90 index 324ab78d160..1b85a6152a4 100644 --- a/gcc/testsuite/gfortran.dg/vect/vect-8.f90 +++ b/gcc/testsuite/gfortran.dg/vect/vect-8.f90 @@ -703,4 +703,4 @@ CALL track('KERNEL ') RETURN END SUBROUTINE kernel -! { dg-final { scan-tree-dump-times "vectorized 19 loops" 1 "vect" } } +! { dg-final { scan-tree-dump-times "vectorized 20 loops" 1 "vect" } } diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 755b5a17e50..b3ca9d6e1b8 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -2114,7 +2114,6 @@ vect_analyze_group_access_1 (struct data_reference *dr) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, "not consecutive access "); dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0); - dump_printf (MSG_MISSED_OPTIMIZATION, "\n"); } if (bb_vinfo) @@ -2124,7 +2123,9 @@ vect_analyze_group_access_1 (struct data_reference *dr) return true; } - return false; + dump_printf_loc (MSG_NOTE, vect_location, "using strided accesses\n"); + STMT_VINFO_STRIDED_P (stmt_info) = true; + return true; } if (GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) == stmt)