diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:22:09 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:22:09 +0000 |
commit | 10681ce8cb6227ae5c11cc74ddf48f2fc5e6f87e (patch) | |
tree | 35855509f186bc71e3434bad3b0a5ae381027fc6 /gcc/tree-vect-data-refs.c | |
parent | e1bd72966309ac459a55e2bc64ad355272d402f5 (diff) | |
download | gcc-10681ce8cb6227ae5c11cc74ddf48f2fc5e6f87e.zip gcc-10681ce8cb6227ae5c11cc74ddf48f2fc5e6f87e.tar.gz gcc-10681ce8cb6227ae5c11cc74ddf48f2fc5e6f87e.tar.bz2 |
[13/46] Make STMT_VINFO_RELATED_STMT a stmt_vec_info
This patch changes STMT_VINFO_RELATED_STMT from a gimple stmt to a
stmt_vec_info.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (_stmt_vec_info::related_stmt): Change from
a gimple stmt to a stmt_vec_info.
(is_pattern_stmt_p): Update accordingly.
* tree-vect-data-refs.c (vect_preserves_scalar_order_p): Likewise.
(vect_record_grouped_load_vectors): Likewise.
* tree-vect-loop.c (vect_determine_vf_for_stmt): Likewise.
(vect_fixup_reduc_chain, vect_update_vf_for_slp): Likewise.
(vect_model_reduction_cost): Likewise.
(vect_create_epilog_for_reduction): Likewise.
(vectorizable_reduction, vectorizable_induction): Likewise.
* tree-vect-patterns.c (vect_init_pattern_stmt): Likewise.
Return the stmt_vec_info for the pattern statement.
(vect_set_pattern_stmt): Update use of STMT_VINFO_RELATED_STMT.
(vect_split_statement, vect_mark_pattern_stmts): Likewise.
* tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Likewise.
(vect_detect_hybrid_slp, vect_get_slp_defs): Likewise.
* tree-vect-stmts.c (vect_mark_relevant): Likewise.
(vect_get_vec_def_for_operand_1, vectorizable_call): Likewise.
(vectorizable_simd_clone_call, vect_analyze_stmt, new_stmt_vec_info)
(free_stmt_vec_info, vect_is_simple_use): Likewise.
From-SVN: r263128
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 65b49bf..70dd466 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -213,10 +213,10 @@ vect_preserves_scalar_order_p (gimple *stmt_a, gimple *stmt_b) current position (but could happen earlier). Reordering is therefore only possible if the first access is a write. */ if (is_pattern_stmt_p (stmtinfo_a)) - stmt_a = STMT_VINFO_RELATED_STMT (stmtinfo_a); + stmtinfo_a = STMT_VINFO_RELATED_STMT (stmtinfo_a); if (is_pattern_stmt_p (stmtinfo_b)) - stmt_b = STMT_VINFO_RELATED_STMT (stmtinfo_b); - gimple *earlier_stmt = get_earlier_stmt (stmt_a, stmt_b); + stmtinfo_b = STMT_VINFO_RELATED_STMT (stmtinfo_b); + gimple *earlier_stmt = get_earlier_stmt (stmtinfo_a, stmtinfo_b); return !DR_IS_WRITE (STMT_VINFO_DATA_REF (vinfo_for_stmt (earlier_stmt))); } @@ -6359,8 +6359,10 @@ vect_transform_grouped_load (gimple *stmt, vec<tree> dr_chain, int size, void vect_record_grouped_load_vectors (gimple *stmt, vec<tree> result_chain) { - gimple *first_stmt = DR_GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)); - gimple *next_stmt, *new_stmt; + stmt_vec_info stmt_info = vinfo_for_stmt (stmt); + vec_info *vinfo = stmt_info->vinfo; + gimple *first_stmt = DR_GROUP_FIRST_ELEMENT (stmt_info); + gimple *next_stmt; unsigned int i, gap_count; tree tmp_data_ref; @@ -6389,29 +6391,28 @@ vect_record_grouped_load_vectors (gimple *stmt, vec<tree> result_chain) while (next_stmt) { - new_stmt = SSA_NAME_DEF_STMT (tmp_data_ref); + stmt_vec_info new_stmt_info = vinfo->lookup_def (tmp_data_ref); /* We assume that if VEC_STMT is not NULL, this is a case of multiple copies, and we put the new vector statement in the first available RELATED_STMT. */ if (!STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt))) - STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt)) = new_stmt; + STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt)) = new_stmt_info; else { if (!DR_GROUP_SAME_DR_STMT (vinfo_for_stmt (next_stmt))) { gimple *prev_stmt = STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt)); - gimple *rel_stmt = - STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)); - while (rel_stmt) + stmt_vec_info rel_stmt_info + = STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)); + while (rel_stmt_info) { - prev_stmt = rel_stmt; - rel_stmt = - STMT_VINFO_RELATED_STMT (vinfo_for_stmt (rel_stmt)); + prev_stmt = rel_stmt_info; + rel_stmt_info = STMT_VINFO_RELATED_STMT (rel_stmt_info); } - STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)) = - new_stmt; + STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt)) + = new_stmt_info; } } |