diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-06-20 08:06:27 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-06-20 08:06:27 +0000 |
commit | e3947d809d75c6bc47e600ce490c238006c2de2b (patch) | |
tree | 556707591b83d585de8ceef3746d12aaea8c5132 /gcc/tree-vect-patterns.c | |
parent | d54a098e48987e7368ff190b703efd72aba9e6d9 (diff) | |
download | gcc-e3947d809d75c6bc47e600ce490c238006c2de2b.zip gcc-e3947d809d75c6bc47e600ce490c238006c2de2b.tar.gz gcc-e3947d809d75c6bc47e600ce490c238006c2de2b.tar.bz2 |
[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 <richard.sandiford@arm.com>
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
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 19d4ea9..5d0543f 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -405,13 +405,13 @@ vect_recog_dot_prod_pattern (vec<gimple *> *stmts, tree *type_in, stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo); if (gimple_assign_rhs_code (stmt) != WIDEN_MULT_EXPR) return NULL; + STMT_VINFO_PATTERN_DEF_SEQ (vinfo_for_stmt (last_stmt)) + = STMT_VINFO_PATTERN_DEF_SEQ (stmt_vinfo); stmt_vinfo = vinfo_for_stmt (stmt); gcc_assert (stmt_vinfo); gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_internal_def); oprnd00 = gimple_assign_rhs1 (stmt); oprnd01 = gimple_assign_rhs2 (stmt); - STMT_VINFO_PATTERN_DEF_SEQ (vinfo_for_stmt (last_stmt)) - = STMT_VINFO_PATTERN_DEF_SEQ (stmt_vinfo); } else { @@ -4433,28 +4433,23 @@ vect_mark_pattern_stmts (gimple *orig_stmt, gimple *pattern_stmt, STMT_VINFO_VECTYPE (pattern_stmt_info) = pattern_vectype; STMT_VINFO_IN_PATTERN_P (orig_stmt_info) = true; STMT_VINFO_RELATED_STMT (orig_stmt_info) = pattern_stmt; - STMT_VINFO_PATTERN_DEF_SEQ (pattern_stmt_info) - = STMT_VINFO_PATTERN_DEF_SEQ (orig_stmt_info); - if (STMT_VINFO_PATTERN_DEF_SEQ (pattern_stmt_info)) - { - gimple_stmt_iterator si; - for (si = gsi_start (STMT_VINFO_PATTERN_DEF_SEQ (pattern_stmt_info)); - !gsi_end_p (si); gsi_next (&si)) - { - def_stmt = gsi_stmt (si); - def_stmt_info = vinfo_for_stmt (def_stmt); - if (def_stmt_info == NULL) - { - def_stmt_info = new_stmt_vec_info (def_stmt, vinfo); - set_vinfo_for_stmt (def_stmt, def_stmt_info); - } - gimple_set_bb (def_stmt, gimple_bb (orig_stmt)); - STMT_VINFO_RELATED_STMT (def_stmt_info) = orig_stmt; - STMT_VINFO_DEF_TYPE (def_stmt_info) = vect_internal_def; - if (STMT_VINFO_VECTYPE (def_stmt_info) == NULL_TREE) - STMT_VINFO_VECTYPE (def_stmt_info) = pattern_vectype; - } - } + if (gimple *def_seq = STMT_VINFO_PATTERN_DEF_SEQ (orig_stmt_info)) + for (gimple_stmt_iterator si = gsi_start (def_seq); + !gsi_end_p (si); gsi_next (&si)) + { + def_stmt = gsi_stmt (si); + def_stmt_info = vinfo_for_stmt (def_stmt); + if (def_stmt_info == NULL) + { + def_stmt_info = new_stmt_vec_info (def_stmt, vinfo); + set_vinfo_for_stmt (def_stmt, def_stmt_info); + } + gimple_set_bb (def_stmt, gimple_bb (orig_stmt)); + STMT_VINFO_RELATED_STMT (def_stmt_info) = orig_stmt; + STMT_VINFO_DEF_TYPE (def_stmt_info) = vect_internal_def; + if (STMT_VINFO_VECTYPE (def_stmt_info) == NULL_TREE) + STMT_VINFO_VECTYPE (def_stmt_info) = pattern_vectype; + } } /* Function vect_pattern_recog_1 |