diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-08-04 10:41:12 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-08-04 10:41:12 +0000 |
commit | 2c515559f9dbe8bace5f68e2fec7600a9edc7c42 (patch) | |
tree | 1be469fb15d4c42c3e6f4ef2d854914280c6b919 /gcc/tree-parloops.c | |
parent | 9adee3052156ae36271be28e3ad47dd975c26f42 (diff) | |
download | gcc-2c515559f9dbe8bace5f68e2fec7600a9edc7c42.zip gcc-2c515559f9dbe8bace5f68e2fec7600a9edc7c42.tar.gz gcc-2c515559f9dbe8bace5f68e2fec7600a9edc7c42.tar.bz2 |
C++-ify vec_info structures
This patch uses new, delete, constructors and desctructors to manage
vec_info. This includes making ~vec_info free all the data shared
by bb_vec_info and loop_vec_info, whereas previously the code was
duplicated in destroy_bb_vec_info and destroy_loop_vec_info. This
in turn meant changing the order of:
FOR_EACH_VEC_ELT (slp_instances, i, instance)
vect_free_slp_instance (instance);
and:
gimple_set_uid (stmt, -1);
in destroy_bb_vec_info/~_bb_vec_info, so that now vect_free_slp_instance
could see a uid of -1 as well as 0. The patch updates vinfo_for_stmt
so that it returns NULL for a uid of -1.
2017-08-04 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* tree-vectorizer.h (vec_info): Add a constructor and destructor.
Add an explicit name for the enum. Use auto_vec for slp_instances
and grouped_stores.
(_loop_vec_info): Add a constructor and destructor. Use auto_vec
for all vectors.
(_bb_vec_info): Add a constructor and destructor.
(vinfo_for_stmt): Return NULL for uids of -1 as well.
(destroy_loop_vec_info): Delete.
(vect_destroy_datarefs): Likewise.
* tree-vectorizer.c (vect_destroy_datarefs): Delete.
(vec_info::vec_info): New function.
(vec_info::~vec_info): Likewise.
(vectorize_loops): Use delete instead of destroy_loop_vec_info.
* tree-parloops.c (gather_scalar_reductions): Use delete instead of
destroy_loop_vec_info.
* tree-vect-loop.c (new_loop_vec_info): Replace with...
(_loop_vec_info::_loop_vec_info): ...this.
(destroy_loop_vec_info): Replace with...
(_loop_vec_info::~_loop_vec_info): ...this. Unconditionally delete
the stmt_vec_infos. Leave handling of vec_info information to its
destructor. Remove explicit vector releases.
(vect_analyze_loop_form): Use new instead of new_loop_vec_info.
(vect_analyze_loop): Use delete instead of destroy_loop_vec_info.
* tree-vect-slp.c (new_bb_vec_info): Replace with...
(_bb_vec_info::_bb_vec_info): ...this. Don't reserve space in
BB_VINFO_GROUPED_STORES or BB_VINFO_SLP_INSTANCES.
(destroy_bb_vec_info): Replace with...
(_bb_vec_info::~_bb_vec_info): ...this. Leave handling of vec_info
information to its destructor.
(vect_slp_analyze_bb_1): Use new and delete instead of
new_bb_vec_info and destroy_bb_vec_info.
(vect_slp_bb): Replace 2 calls to destroy_bb_vec_info with a
single delete.
From-SVN: r250869
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r-- | gcc/tree-parloops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 538932e..59e261d 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2577,7 +2577,7 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list build_new_reduction (reduction_list, reduc_stmt, phi); } - destroy_loop_vec_info (simple_loop_info, true); + delete simple_loop_info; if (!double_reduc_phis.is_empty ()) { @@ -2613,7 +2613,7 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list build_new_reduction (reduction_list, double_reduc_stmts[i], phi); } - destroy_loop_vec_info (simple_loop_info, true); + delete simple_loop_info; } } |