diff options
author | Richard Biener <rguenther@suse.de> | 2020-06-10 13:47:12 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-06-10 15:13:06 +0200 |
commit | f25161bdcc2b098a4678a42bb2c581ac47625b17 (patch) | |
tree | e7fce2151918124618cb35ec4c741b3883af10a0 /gcc/tree-vectorizer.h | |
parent | 1396fa5b91cfa0b3708ec9df33c0bb84386081d6 (diff) | |
download | gcc-f25161bdcc2b098a4678a42bb2c581ac47625b17.zip gcc-f25161bdcc2b098a4678a42bb2c581ac47625b17.tar.gz gcc-f25161bdcc2b098a4678a42bb2c581ac47625b17.tar.bz2 |
Make {SLP_TREE,STMT_VINFO}_VEC_STMTS a vector of gimple *
This makes {SLP_TREE,STMT_VINFO}_VEC_STMTS a vector of gimple * and
not allocate a stmt_vec_info for vectorizer generated stmts since
this is now possible after removing the only use which was chaining
of vector stmts via STMT_VINFO_RELATED_STMT.
This also removes all stmt_vec_info allocations done for vector
stmts, the remaining ones are for stmts in the scalar IL and for
patterns which are not part of the IL. Thus after this the stmt
UIDs inside a basic-block are suitable for dominance checking
if you ignore (or lazy-fill) UIDs of zero of the vector stmts
inserted during transform. This property is ensured by a new
flag set when pattern analysis is complete.
2020-06-10 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (_slp_tree::vec_stmts): Make it a vector
of gimple * stmts.
(_stmt_vec_info::vec_stmts): Likewise.
(vec_info::stmt_vec_info_ro): New flag.
(vect_finish_replace_stmt): Adjust declaration.
(vect_finish_stmt_generation): Likewise.
(vectorizable_induction): Likewise.
(vect_transform_reduction): Likewise.
(vectorizable_lc_phi): Likewise.
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Do not
allocate stmt infos for increments.
(vect_record_grouped_load_vectors): Adjust.
* tree-vect-loop.c (vect_create_epilog_for_reduction): Likewise.
(vectorize_fold_left_reduction): Likewise.
(vect_transform_reduction): Likewise.
(vect_transform_cycle_phi): Likewise.
(vectorizable_lc_phi): Likewise.
(vectorizable_induction): Likewise.
(vectorizable_live_operation): Likewise.
(vect_transform_loop): Likewise.
* tree-vect-patterns.c (vect_pattern_recog): Set stmt_vec_info_ro.
* tree-vect-slp.c (vect_get_slp_vect_def): Adjust.
(vect_get_slp_defs): Likewise.
(vect_transform_slp_perm_load): Likewise.
(vect_schedule_slp_instance): Likewise.
(vectorize_slp_instance_root_stmt): Likewise.
* tree-vect-stmts.c (vect_get_vec_defs_for_operand): Likewise.
(vect_finish_stmt_generation_1): Do not allocate a stmt info.
(vect_finish_replace_stmt): Do not return anything.
(vect_finish_stmt_generation): Likewise.
(vect_build_gather_load_calls): Adjust.
(vectorizable_bswap): Likewise.
(vectorizable_call): Likewise.
(vectorizable_simd_clone_call): Likewise.
(vect_create_vectorized_demotion_stmts): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_scan_store): Likewise.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison): Likewise.
(vect_transform_stmt): Likewise.
* tree-vectorizer.c (vec_info::vec_info): Initialize
stmt_vec_info_ro.
(vec_info::replace_stmt): Copy over stmt UID rather than
unsetting/setting a stmt info allocating a new UID.
(vec_info::set_vinfo_for_stmt): Assert !stmt_vec_info_ro.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index df05638..14f68f7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -138,7 +138,7 @@ struct _slp_tree { tree vectype; /* Vectorized stmt/s. */ - vec<stmt_vec_info> vec_stmts; + vec<gimple *> vec_stmts; vec<tree> vec_defs; /* Number of vector stmts that are created to replace the group of scalar stmts. It is calculated during the transformation phase as the number of @@ -338,6 +338,8 @@ public: /* The mapping of GIMPLE UID to stmt_vec_info. */ vec<stmt_vec_info> stmt_vec_infos; + /* Whether the above mapping is complete. */ + bool stmt_vec_info_ro; /* The SLP graph. */ auto_vec<slp_instance> slp_instances; @@ -965,7 +967,7 @@ public: tree vectype; /* The vectorized stmts. */ - vec<stmt_vec_info> vec_stmts; + vec<gimple *> vec_stmts; /* The following is relevant only for stmts that contain a non-scalar data-ref (array/pointer/struct access). A GIMPLE stmt is expected to have @@ -1126,8 +1128,6 @@ public: /* True if this is only suitable for SLP vectorization. */ bool slp_vect_only_p; - - bool vector_stmt; }; /* Information about a gather/scatter call. */ @@ -1169,7 +1169,7 @@ struct gather_scatter_info { #define STMT_VINFO_RELEVANT(S) (S)->relevant #define STMT_VINFO_LIVE_P(S) (S)->live #define STMT_VINFO_VECTYPE(S) (S)->vectype -#define STMT_VINFO_VEC_STMTS(S) (S)->vec_stmts +#define STMT_VINFO_VEC_STMTS(S) (S)->vec_stmts #define STMT_VINFO_VECTORIZABLE(S) (S)->vectorizable #define STMT_VINFO_DATA_REF(S) ((S)->dr_aux.dr + 0) #define STMT_VINFO_GATHER_SCATTER_P(S) (S)->gather_scatter_p @@ -1737,11 +1737,9 @@ record_stmt_cost (stmt_vector_for_cost *body_cost_vec, int count, STMT_VINFO_VECTYPE (stmt_info), misalign, where); } -extern stmt_vec_info vect_finish_replace_stmt (vec_info *, - stmt_vec_info, gimple *); -extern stmt_vec_info vect_finish_stmt_generation (vec_info *, - stmt_vec_info, gimple *, - gimple_stmt_iterator *); +extern void vect_finish_replace_stmt (vec_info *, stmt_vec_info, gimple *); +extern void vect_finish_stmt_generation (vec_info *, stmt_vec_info, gimple *, + gimple_stmt_iterator *); extern opt_result vect_mark_stmts_to_be_vectorized (loop_vec_info, bool *); extern tree vect_get_store_rhs (stmt_vec_info); void vect_get_vec_defs_for_operand (vec_info *vinfo, stmt_vec_info, unsigned, @@ -1872,16 +1870,16 @@ extern bool vectorizable_reduction (loop_vec_info, stmt_vec_info, stmt_vector_for_cost *); extern bool vectorizable_induction (loop_vec_info, stmt_vec_info, gimple_stmt_iterator *, - stmt_vec_info *, slp_tree, + gimple **, slp_tree, stmt_vector_for_cost *); extern bool vect_transform_reduction (loop_vec_info, stmt_vec_info, gimple_stmt_iterator *, - stmt_vec_info *, slp_tree); + gimple **, slp_tree); extern bool vect_transform_cycle_phi (loop_vec_info, stmt_vec_info, - stmt_vec_info *, + gimple **, slp_tree, slp_instance); extern bool vectorizable_lc_phi (loop_vec_info, stmt_vec_info, - stmt_vec_info *, slp_tree); + gimple **, slp_tree); extern bool vect_worthwhile_without_simd_p (vec_info *, tree_code); extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, stmt_vector_for_cost *, |