aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-06-05 12:38:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-06-05 12:38:26 +0000
commit1aedeafec2f661a62da75cf0af9f366f4b2ce708 (patch)
tree844d765cdd7406bfd07a3536ee202883a99d0759
parent7ad672e46e3a251f850efd0e0c2f7351493d9bf6 (diff)
downloadgcc-1aedeafec2f661a62da75cf0af9f366f4b2ce708.zip
gcc-1aedeafec2f661a62da75cf0af9f366f4b2ce708.tar.gz
gcc-1aedeafec2f661a62da75cf0af9f366f4b2ce708.tar.bz2
re PR middle-end/30442 (Expanded array initialization can use memset builtin function)
2012-06-05 Richard Guenther <rguenther@suse.de> PR tree-optimization/30442 * tree-vect-data-refs.c (vect_analyze_data_refs): For basic-block vectorization stop analysis at the first stmt we cannot compute a data-reference for instead of giving up completely. * gcc.dg/vect/bb-slp-30.c: New testcase. From-SVN: r188235
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-30.c47
-rw-r--r--gcc/tree-vect-data-refs.c20
4 files changed, 75 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a3fd74..50b3245 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2012-06-05 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/30442
+ * tree-vect-data-refs.c (vect_analyze_data_refs): For basic-block
+ vectorization stop analysis at the first stmt we cannot compute
+ a data-reference for instead of giving up completely.
+
+2012-06-05 Richard Guenther <rguenther@suse.de>
+
* tree-loop-distribution.c (struct partition_s): Add has_writes
member.
(partition_alloc): Initialize it.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3bfc678..e237c41 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2012-06-05 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/30442
+ * gcc.dg/vect/bb-slp-30.c: New testcase.
+
+2012-06-05 Richard Guenther <rguenther@suse.de>
+
PR tree-optimization/53081
* gcc.dg/tree-ssa/ldist-19.c: New testcase.
* gcc.c-torture/execute/builtins/builtins.exp: Always pass
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-30.c b/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
new file mode 100644
index 0000000..63689e34
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-30.c
@@ -0,0 +1,47 @@
+/* { dg-require-effective-target vect_int } */
+
+int a[32];
+
+void __attribute__((noinline))
+test1(void)
+{
+ a[0] = 1;
+ a[1] = 1;
+ a[2] = 1;
+ a[3] = 1;
+ a[4] = 1;
+ a[5] = 1;
+ a[6] = 1;
+ a[7] = 1;
+ a[8] = 1;
+ a[9] = 1;
+ a[10] = 1;
+ a[11] = 1;
+ a[12] = 1;
+ a[13] = 1;
+ a[14] = 1;
+ a[15] = 1;
+ a[16] = 1;
+ a[17] = 1;
+ a[18] = 1;
+ a[19] = 1;
+ a[20] = 1;
+ a[21] = 1;
+ a[22] = 1;
+ a[23] = 1;
+ a[24] = 1;
+ a[25] = 1;
+ a[26] = 1;
+ a[27] = 1;
+ a[28] = 1;
+ a[29] = 1;
+ a[30] = 1;
+ a[31] = 1;
+ asm ("" : : : "memory");
+ a[21] = 0;
+}
+
+int main() { test1(); return a[21]; }
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" } } */
+/* { dg-final { cleanup-tree-dump "slp" } } */
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index e34f41a..aa384d2 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2844,11 +2844,23 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
}
else
{
+ gimple_stmt_iterator gsi;
+
bb = BB_VINFO_BB (bb_vinfo);
- res = compute_data_dependences_for_bb (bb, true,
- &BB_VINFO_DATAREFS (bb_vinfo),
- &BB_VINFO_DDRS (bb_vinfo));
- if (!res)
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ if (!find_data_references_in_stmt (NULL, stmt,
+ &BB_VINFO_DATAREFS (bb_vinfo)))
+ {
+ /* Mark the rest of the basic-block as unvectorizable. */
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
+ STMT_VINFO_VECTORIZABLE (vinfo_for_stmt (stmt)) = false;
+ break;
+ }
+ }
+ if (!compute_all_dependences (BB_VINFO_DATAREFS (bb_vinfo),
+ &BB_VINFO_DDRS (bb_vinfo), NULL, true))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
fprintf (vect_dump, "not vectorized: basic block contains function"