re PR tree-optimization/19049 (not vectorizing a fortran loop)

2015-10-22  Richard Biener  <rguenther@suse.de>

	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
This commit is contained in:
Richard Biener 2015-10-22 13:33:17 +00:00 committed by Richard Biener
parent a51ca2f495
commit 90a7a1b5b2
9 changed files with 32 additions and 15 deletions

View File

@ -1,3 +1,10 @@
2015-10-22 Richard Biener <rguenther@suse.de>
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 <rguenther@suse.de>
PR middle-end/68046

View File

@ -1,3 +1,15 @@
2015-10-22 Richard Biener <rguenther@suse.de>
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 <rguenther@suse.de>
PR middle-end/68046

View File

@ -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" } } */

View File

@ -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} } } } } */

View File

@ -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 } } } */

View File

@ -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 } } } */

View File

@ -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" } }

View File

@ -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" } }

View File

@ -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)