+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
+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
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++)
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" } } */
abort ();
}
- /* not consecutive */
+ /* not consecutive, will use strided stores */
for (i = 0; i < N; i++)
for (j = 3; j < N-3; j++)
{
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} } } } } */
}
ptr = arr;
- /* Not vectorizable: gap in store. */
+ /* gap in store, use strided stores */
for (i = 0; i < N; i++)
{
res[i].a = ptr->b;
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 } } } */
}
ptr = arr;
- /* Not vectorizable: gap in store. */
+ /* gap in store, use strided stores. */
for (i = 0; i < N; i++)
{
res[i].a = ptr->b;
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 } } } */
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" } }
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" } }
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)
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)