summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-10 13:07:42 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-10 13:07:42 +0000
commit1824e1e213e7a29d02a25463647825cf0e953de5 (patch)
treee0266031eee2ea4d54a8c68c3bf87c9ca4a70ea6 /gcc/tree-vect-slp.c
parente2ab68814e4f220f3fc9bc1c6fa4525c9d2bd1c0 (diff)
downloadgcc-1824e1e213e7a29d02a25463647825cf0e953de5.tar.gz
2014-01-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/59374 * tree-vect-slp.c (vect_slp_analyze_bb_1): Move dependence checking after SLP discovery. Mark stmts not participating in any SLP instance properly. * gcc.dg/torture/pr59374-3.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 2b075dfea96..372d7db3e70 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2110,17 +2110,6 @@ vect_slp_analyze_bb_1 (basic_block bb)
vect_pattern_recog (NULL, bb_vinfo);
- if (!vect_slp_analyze_data_ref_dependences (bb_vinfo))
- {
- if (dump_enabled_p ())
- dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
- "not vectorized: unhandled data dependence "
- "in basic block.\n");
-
- destroy_bb_vec_info (bb_vinfo);
- return NULL;
- }
-
if (!vect_analyze_data_refs_alignment (NULL, bb_vinfo))
{
if (dump_enabled_p ())
@@ -2155,6 +2144,29 @@ vect_slp_analyze_bb_1 (basic_block bb)
vect_mark_slp_stmts_relevant (SLP_INSTANCE_TREE (instance));
}
+ /* Mark all the statements that we do not want to vectorize. */
+ for (gimple_stmt_iterator gsi = gsi_start_bb (BB_VINFO_BB (bb_vinfo));
+ !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ stmt_vec_info vinfo = vinfo_for_stmt (gsi_stmt (gsi));
+ if (STMT_SLP_TYPE (vinfo) != pure_slp)
+ STMT_VINFO_VECTORIZABLE (vinfo) = false;
+ }
+
+ /* Analyze dependences. At this point all stmts not participating in
+ vectorization have to be marked. Dependence analysis assumes
+ that we either vectorize all SLP instances or none at all. */
+ if (!vect_slp_analyze_data_ref_dependences (bb_vinfo))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "not vectorized: unhandled data dependence "
+ "in basic block.\n");
+
+ destroy_bb_vec_info (bb_vinfo);
+ return NULL;
+ }
+
if (!vect_verify_datarefs_alignment (NULL, bb_vinfo))
{
if (dump_enabled_p ())