diff options
author | Richard Biener <rguenther@suse.de> | 2018-05-29 11:49:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-05-29 11:49:44 +0000 |
commit | f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8 (patch) | |
tree | fd063fc6faee62c11cf26bbb7454f96ed1214453 /gcc/tree-vectorizer.c | |
parent | 092cb01cbf25e1c19d0b86bfac6dc4404c14a7dd (diff) | |
download | gcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.zip gcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.tar.gz gcc-f8c0baaf31ac987bd1e85a3ba2fa8a2edeff92a8.tar.bz2 |
tree-vectorizer.h (struct vec_info): Add stmt_vec_infos member.
2018-05-29 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (struct vec_info): Add stmt_vec_infos
member.
(stmt_vec_info_vec): Make pointer.
(init_stmt_vec_info_vec): Remove.
(free_stmt_vec_info_vec): Likewise.
(set_stmt_vec_info_vec): New function.
(free_stmt_vec_infos): Likewise.
(vinfo_for_stmt): Adjust for stmt_vec_info_vec indirection.
(set_vinfo_for_stmt): Likewise.
(get_earlier_stmt): Likewise.
(get_later_stmt): Likewise.
* tree-vectorizer.c (stmt_vec_info_vec): Make pointer.
(vec_info::vec_info): Allocate stmt_vec_infos and set the global.
(vec_info::~vec_info): Free stmt_vec_infos.
(vectorize_loops): Set the global stmt_vec_info_vec to NULL.
Remove old init_stmt_vec_info_vec/free_stmt_vec_info_vec calls.
(pass_slp_vectorize::execute): Likewise.
* tree-vect-stmts.c (init_stmt_vec_info_vec): Remove.
(free_stmt_vec_info_vec): Likewise.
(set_stmt_vec_info_vec): New function.
(free_stmt_vec_infos): Likewise.
* tree-vect-loop.c (_loop_vec_info::~_loop_vec_info): Set
the global stmt_vec_info_vec.
* tree-parloops.c (gather_scalar_reductions): Use
set_stmt_vec_info_vec/free_stmt_vec_infos and maintain a local
vector.
From-SVN: r260892
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 86cd025..8ff90b3 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -85,7 +85,7 @@ along with GCC; see the file COPYING3. If not see source_location vect_location; /* Vector mapping GIMPLE stmt to stmt_vec_info. */ -vec<stmt_vec_info> stmt_vec_info_vec; +vec<stmt_vec_info> *stmt_vec_info_vec; /* Dump a cost entry according to args to F. */ @@ -456,6 +456,8 @@ vec_info::vec_info (vec_info::vec_kind kind_in, void *target_cost_data_in) ddrs (vNULL), target_cost_data (target_cost_data_in) { + stmt_vec_infos.create (50); + set_stmt_vec_info_vec (&stmt_vec_infos); } vec_info::~vec_info () @@ -477,6 +479,7 @@ vec_info::~vec_info () free_data_refs (datarefs); free_dependence_relations (ddrs); destroy_cost_data (target_cost_data); + free_stmt_vec_infos (&stmt_vec_infos); } /* A helper function to free scev and LOOP niter information, as well as @@ -682,7 +685,7 @@ vectorize_loops (void) if (cfun->has_simduid_loops) note_simd_array_uses (&simd_array_to_simduid_htab); - init_stmt_vec_info_vec (); + set_stmt_vec_info_vec (NULL); /* ----------- Analyze loops. ----------- */ @@ -923,8 +926,6 @@ vectorize_loops (void) loop->aux = NULL; } - free_stmt_vec_info_vec (); - /* Fold IFN_GOMP_SIMD_{VF,LANE,LAST_LANE,ORDERED_{START,END}} builtins. */ if (cfun->has_simduid_loops) adjust_simduid_builtins (simduid_to_vf_htab); @@ -1062,8 +1063,6 @@ pass_slp_vectorize::execute (function *fun) } } - init_stmt_vec_info_vec (); - FOR_EACH_BB_FN (bb, fun) { if (vect_slp_bb (bb)) @@ -1071,8 +1070,6 @@ pass_slp_vectorize::execute (function *fun) "basic block vectorized\n"); } - free_stmt_vec_info_vec (); - if (!in_loop_pipeline) { scev_finalize (); |