diff options
author | Richard Guenther <rguenther@suse.de> | 2012-06-05 12:38:26 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-06-05 12:38:26 +0000 |
commit | 1aedeafec2f661a62da75cf0af9f366f4b2ce708 (patch) | |
tree | 844d765cdd7406bfd07a3536ee202883a99d0759 /gcc/tree-vect-data-refs.c | |
parent | 7ad672e46e3a251f850efd0e0c2f7351493d9bf6 (diff) | |
download | gcc-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
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 20 |
1 files changed, 16 insertions, 4 deletions
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" |