diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:21:37 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:21:37 +0000 |
commit | 4fbeb36361aab0c197c01f6268e442446f2c1fa8 (patch) | |
tree | 9fcd870099d9579c265eb76a06868f24305a38cf /gcc/tree-vect-patterns.c | |
parent | 79cc8302f73a56dd1e84e87a26d35ed7e5bfea53 (diff) | |
download | gcc-4fbeb36361aab0c197c01f6268e442446f2c1fa8.zip gcc-4fbeb36361aab0c197c01f6268e442446f2c1fa8.tar.gz gcc-4fbeb36361aab0c197c01f6268e442446f2c1fa8.tar.bz2 |
[06/46] Add vec_info::add_stmt
This patch adds a vec_info function for allocating and setting
stmt_vec_infos. It's the start of a long process of removing
the global stmt_vec_info array.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (stmt_vec_info): Move typedef earlier in file.
(vec_info::add_stmt): Declare.
* tree-vectorizer.c (vec_info::add_stmt): New function.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Use it.
* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Likewise.
(vect_create_epilog_for_reduction, vectorizable_reduction): Likewise.
(vectorizable_induction): Likewise.
* tree-vect-slp.c (_bb_vec_info::_bb_vec_info): Likewise.
* tree-vect-stmts.c (vect_finish_stmt_generation_1): Likewise.
(vectorizable_simd_clone_call, vectorizable_store): Likewise.
(vectorizable_load): Likewise.
* tree-vect-patterns.c (vect_init_pattern_stmt): Likewise.
(vect_recog_bool_pattern, vect_recog_mask_conversion_pattern)
(vect_recog_gather_scatter_pattern): Likewise.
(append_pattern_def_seq): Likewise. Remove a check that is
performed by add_stmt itself.
From-SVN: r263121
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 0f63ccf..1a431e7 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -103,11 +103,7 @@ vect_init_pattern_stmt (gimple *pattern_stmt, stmt_vec_info orig_stmt_info, { stmt_vec_info pattern_stmt_info = vinfo_for_stmt (pattern_stmt); if (pattern_stmt_info == NULL) - { - pattern_stmt_info = new_stmt_vec_info (pattern_stmt, - orig_stmt_info->vinfo); - set_vinfo_for_stmt (pattern_stmt, pattern_stmt_info); - } + pattern_stmt_info = orig_stmt_info->vinfo->add_stmt (pattern_stmt); gimple_set_bb (pattern_stmt, gimple_bb (orig_stmt_info->stmt)); STMT_VINFO_RELATED_STMT (pattern_stmt_info) = orig_stmt_info->stmt; @@ -141,9 +137,7 @@ append_pattern_def_seq (stmt_vec_info stmt_info, gimple *new_stmt, vec_info *vinfo = stmt_info->vinfo; if (vectype) { - gcc_assert (!vinfo_for_stmt (new_stmt)); - stmt_vec_info new_stmt_info = new_stmt_vec_info (new_stmt, vinfo); - set_vinfo_for_stmt (new_stmt, new_stmt_info); + stmt_vec_info new_stmt_info = vinfo->add_stmt (new_stmt); STMT_VINFO_VECTYPE (new_stmt_info) = vectype; } gimple_seq_add_stmt_without_update (&STMT_VINFO_PATTERN_DEF_SEQ (stmt_info), @@ -3832,8 +3826,7 @@ vect_recog_bool_pattern (stmt_vec_info stmt_vinfo, tree *type_out) rhs = rhs2; } pattern_stmt = gimple_build_assign (lhs, SSA_NAME, rhs); - pattern_stmt_info = new_stmt_vec_info (pattern_stmt, vinfo); - set_vinfo_for_stmt (pattern_stmt, pattern_stmt_info); + pattern_stmt_info = vinfo->add_stmt (pattern_stmt); STMT_VINFO_DATA_REF (pattern_stmt_info) = STMT_VINFO_DATA_REF (stmt_vinfo); STMT_VINFO_DR_WRT_VEC_LOOP (pattern_stmt_info) @@ -3958,8 +3951,7 @@ vect_recog_mask_conversion_pattern (stmt_vec_info stmt_vinfo, tree *type_out) } gimple_call_set_nothrow (pattern_stmt, true); - pattern_stmt_info = new_stmt_vec_info (pattern_stmt, vinfo); - set_vinfo_for_stmt (pattern_stmt, pattern_stmt_info); + pattern_stmt_info = vinfo->add_stmt (pattern_stmt); if (STMT_VINFO_DATA_REF (stmt_vinfo)) { STMT_VINFO_DATA_REF (pattern_stmt_info) @@ -4290,9 +4282,7 @@ vect_recog_gather_scatter_pattern (stmt_vec_info stmt_info, tree *type_out) /* Copy across relevant vectorization info and associate DR with the new pattern statement instead of the original statement. */ - stmt_vec_info pattern_stmt_info = new_stmt_vec_info (pattern_stmt, - loop_vinfo); - set_vinfo_for_stmt (pattern_stmt, pattern_stmt_info); + stmt_vec_info pattern_stmt_info = loop_vinfo->add_stmt (pattern_stmt); STMT_VINFO_DATA_REF (pattern_stmt_info) = dr; STMT_VINFO_DR_WRT_VEC_LOOP (pattern_stmt_info) = STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info); |