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-stmts.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-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index f420a42..21de238 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1744,7 +1744,7 @@ vect_finish_stmt_generation_1 (gimple *stmt, gimple *vec_stmt) stmt_vec_info stmt_info = vinfo_for_stmt (stmt); vec_info *vinfo = stmt_info->vinfo; - set_vinfo_for_stmt (vec_stmt, new_stmt_vec_info (vec_stmt, vinfo)); + vinfo->add_stmt (vec_stmt); if (dump_enabled_p ()) { @@ -4183,8 +4183,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, } tree phi_res = copy_ssa_name (op); gphi *new_phi = create_phi_node (phi_res, loop->header); - set_vinfo_for_stmt (new_phi, - new_stmt_vec_info (new_phi, loop_vinfo)); + loop_vinfo->add_stmt (new_phi); add_phi_arg (new_phi, arginfo[i].op, loop_preheader_edge (loop), UNKNOWN_LOCATION); enum tree_code code @@ -4201,8 +4200,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, = gimple_build_assign (phi_arg, code, phi_res, tcst); gimple_stmt_iterator si = gsi_after_labels (loop->header); gsi_insert_after (&si, new_stmt, GSI_NEW_STMT); - set_vinfo_for_stmt (new_stmt, - new_stmt_vec_info (new_stmt, loop_vinfo)); + loop_vinfo->add_stmt (new_stmt); add_phi_arg (new_phi, phi_arg, loop_latch_edge (loop), UNKNOWN_LOCATION); arginfo[i].op = phi_res; @@ -6731,7 +6729,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, loop, &incr_gsi, insert_after, &offvar, NULL); incr = gsi_stmt (incr_gsi); - set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo)); + loop_vinfo->add_stmt (incr); stride_step = cse_and_gimplify_to_preheader (loop_vinfo, stride_step); @@ -7729,7 +7727,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, loop, &incr_gsi, insert_after, &offvar, NULL); incr = gsi_stmt (incr_gsi); - set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo)); + loop_vinfo->add_stmt (incr); stride_step = cse_and_gimplify_to_preheader (loop_vinfo, stride_step); @@ -8488,8 +8486,7 @@ vectorizable_load (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt, (gimple_assign_rhs1 (stmt)))); new_temp = vect_init_vector (stmt, tem, vectype, NULL); new_stmt = SSA_NAME_DEF_STMT (new_temp); - set_vinfo_for_stmt (new_stmt, - new_stmt_vec_info (new_stmt, vinfo)); + vinfo->add_stmt (new_stmt); } else { |