From e3947d809d75c6bc47e600ce490c238006c2de2b Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 20 Jun 2018 08:06:27 +0000 Subject: [2/n] PR85694: Attach a DEF_SEQ only to the original statement A pattern's PATTERN_DEF_SEQ was attached to both the original statement and the main pattern statement, which made it harder to update later. This patch attaches it to just the original statement. In practice, anything that cared had ready access to both. 2018-06-20 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info): Note above pattern_def_seq that the sequence is attached to the original statement rather than the pattern statement. * tree-vect-loop.c (vect_determine_vf_for_stmt): Take the PATTERN_DEF_SEQ from the original statement rather than the main pattern statement. * tree-vect-stmts.c (free_stmt_vec_info): Likewise. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Likewise. (vect_mark_pattern_stmts): Don't copy the PATTERN_DEF_SEQ. From-SVN: r261785 --- gcc/tree-vect-stmts.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 047edcd..af58d91 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -9876,29 +9876,26 @@ free_stmt_vec_info (gimple *stmt) too. */ if (STMT_VINFO_IN_PATTERN_P (stmt_info)) { + if (gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (stmt_info)) + for (gimple_stmt_iterator si = gsi_start (seq); + !gsi_end_p (si); gsi_next (&si)) + { + gimple *seq_stmt = gsi_stmt (si); + gimple_set_bb (seq_stmt, NULL); + tree lhs = gimple_get_lhs (seq_stmt); + if (lhs && TREE_CODE (lhs) == SSA_NAME) + release_ssa_name (lhs); + free_stmt_vec_info (seq_stmt); + } stmt_vec_info patt_info = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info)); if (patt_info) { - gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (patt_info); gimple *patt_stmt = STMT_VINFO_STMT (patt_info); gimple_set_bb (patt_stmt, NULL); tree lhs = gimple_get_lhs (patt_stmt); if (lhs && TREE_CODE (lhs) == SSA_NAME) release_ssa_name (lhs); - if (seq) - { - gimple_stmt_iterator si; - for (si = gsi_start (seq); !gsi_end_p (si); gsi_next (&si)) - { - gimple *seq_stmt = gsi_stmt (si); - gimple_set_bb (seq_stmt, NULL); - lhs = gimple_get_lhs (seq_stmt); - if (lhs && TREE_CODE (lhs) == SSA_NAME) - release_ssa_name (lhs); - free_stmt_vec_info (seq_stmt); - } - } free_stmt_vec_info (patt_stmt); } } -- cgit v1.1