Commit 78e02b3b by Richard Sandiford Committed by Richard Sandiford

[19/46] Make vect_dr_stmt return a stmt_vec_info

This patch makes vect_dr_stmt return a stmt_vec_info instead of a
gimple stmt.  Rather than retain a separate gimple stmt variable
in cases where both existed, the patch replaces uses of the gimple
variable with the uses of the stmt_vec_info.  Later patches do this
more generally.

Many things that are keyed off a data_reference would these days
be better keyed off a stmt_vec_info, but it's more convenient
to do that later in the series.  The vect_dr_size calls that are
left over do still benefit from this patch.

2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_dr_stmt): Return a stmt_vec_info rather
	than a gimple stmt.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence)
	(vect_slp_analyze_data_ref_dependence, vect_record_base_alignments)
	(vect_calculate_target_alignmentm, vect_compute_data_ref_alignment)
	(vect_update_misalignment_for_peel, vect_verify_datarefs_alignment)
	(vector_alignment_reachable_p, vect_get_data_access_cost)
	(vect_get_peeling_costs_all_drs, vect_peeling_hash_get_lowest_cost)
	(vect_peeling_supportable, vect_enhance_data_refs_alignment)
	(vect_find_same_alignment_drs, vect_analyze_data_refs_alignment)
	(vect_analyze_group_access_1, vect_analyze_group_access)
	(vect_analyze_data_ref_access, vect_analyze_data_ref_accesses)
	(vect_vfa_access_size, vect_small_gap_p, vect_analyze_data_refs)
	(vect_supportable_dr_alignment): Remove vinfo_for_stmt from the
	result of vect_dr_stmt and use the stmt_vec_info instead of
	the associated gimple stmt.
	* tree-vect-loop-manip.c (get_misalign_in_elems): Likewise.
	(vect_gen_prolog_loop_niters): Likewise.
	* tree-vect-loop.c (vect_analyze_loop_2): Likewise.

From-SVN: r263134
parent b9787581
2018-07-31 Richard Sandiford <richard.sandiford@arm.com> 2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (vect_dr_stmt): Return a stmt_vec_info rather
than a gimple stmt.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence)
(vect_slp_analyze_data_ref_dependence, vect_record_base_alignments)
(vect_calculate_target_alignmentm, vect_compute_data_ref_alignment)
(vect_update_misalignment_for_peel, vect_verify_datarefs_alignment)
(vector_alignment_reachable_p, vect_get_data_access_cost)
(vect_get_peeling_costs_all_drs, vect_peeling_hash_get_lowest_cost)
(vect_peeling_supportable, vect_enhance_data_refs_alignment)
(vect_find_same_alignment_drs, vect_analyze_data_refs_alignment)
(vect_analyze_group_access_1, vect_analyze_group_access)
(vect_analyze_data_ref_access, vect_analyze_data_ref_accesses)
(vect_vfa_access_size, vect_small_gap_p, vect_analyze_data_refs)
(vect_supportable_dr_alignment): Remove vinfo_for_stmt from the
result of vect_dr_stmt and use the stmt_vec_info instead of
the associated gimple stmt.
* tree-vect-loop-manip.c (get_misalign_in_elems): Likewise.
(vect_gen_prolog_loop_niters): Likewise.
* tree-vect-loop.c (vect_analyze_loop_2): Likewise.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (_slp_tree::stmts): Change from a vec<gimple *> * tree-vectorizer.h (_slp_tree::stmts): Change from a vec<gimple *>
to a vec<stmt_vec_info>. to a vec<stmt_vec_info>.
* tree-vect-slp.c (vect_free_slp_tree): Update accordingly. * tree-vect-slp.c (vect_free_slp_tree): Update accordingly.
......
...@@ -1560,8 +1560,7 @@ static tree ...@@ -1560,8 +1560,7 @@ static tree
get_misalign_in_elems (gimple **seq, loop_vec_info loop_vinfo) get_misalign_in_elems (gimple **seq, loop_vec_info loop_vinfo)
{ {
struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo); struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
gimple *dr_stmt = vect_dr_stmt (dr); stmt_vec_info stmt_info = vect_dr_stmt (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (dr_stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info); tree vectype = STMT_VINFO_VECTYPE (stmt_info);
unsigned int target_align = DR_TARGET_ALIGNMENT (dr); unsigned int target_align = DR_TARGET_ALIGNMENT (dr);
...@@ -1571,7 +1570,7 @@ get_misalign_in_elems (gimple **seq, loop_vec_info loop_vinfo) ...@@ -1571,7 +1570,7 @@ get_misalign_in_elems (gimple **seq, loop_vec_info loop_vinfo)
tree offset = (negative tree offset = (negative
? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1) ? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1)
: size_zero_node); : size_zero_node);
tree start_addr = vect_create_addr_base_for_vector_ref (dr_stmt, seq, tree start_addr = vect_create_addr_base_for_vector_ref (stmt_info, seq,
offset); offset);
tree type = unsigned_type_for (TREE_TYPE (start_addr)); tree type = unsigned_type_for (TREE_TYPE (start_addr));
tree target_align_minus_1 = build_int_cst (type, target_align - 1); tree target_align_minus_1 = build_int_cst (type, target_align - 1);
...@@ -1631,8 +1630,7 @@ vect_gen_prolog_loop_niters (loop_vec_info loop_vinfo, ...@@ -1631,8 +1630,7 @@ vect_gen_prolog_loop_niters (loop_vec_info loop_vinfo,
tree niters_type = TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo)); tree niters_type = TREE_TYPE (LOOP_VINFO_NITERS (loop_vinfo));
gimple_seq stmts = NULL, new_stmts = NULL; gimple_seq stmts = NULL, new_stmts = NULL;
tree iters, iters_name; tree iters, iters_name;
gimple *dr_stmt = vect_dr_stmt (dr); stmt_vec_info stmt_info = vect_dr_stmt (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (dr_stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info); tree vectype = STMT_VINFO_VECTYPE (stmt_info);
unsigned int target_align = DR_TARGET_ALIGNMENT (dr); unsigned int target_align = DR_TARGET_ALIGNMENT (dr);
......
...@@ -2145,8 +2145,7 @@ start_over: ...@@ -2145,8 +2145,7 @@ start_over:
if (LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) < 0) if (LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) < 0)
{ {
struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo); struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
tree vectype tree vectype = STMT_VINFO_VECTYPE (vect_dr_stmt (dr));
= STMT_VINFO_VECTYPE (vinfo_for_stmt (vect_dr_stmt (dr)));
niters_th += TYPE_VECTOR_SUBPARTS (vectype) - 1; niters_th += TYPE_VECTOR_SUBPARTS (vectype) - 1;
} }
else else
......
...@@ -1370,7 +1370,7 @@ vect_dr_behavior (data_reference *dr) ...@@ -1370,7 +1370,7 @@ vect_dr_behavior (data_reference *dr)
a pattern this returns the corresponding pattern stmt. Otherwise a pattern this returns the corresponding pattern stmt. Otherwise
DR_STMT is returned. */ DR_STMT is returned. */
inline gimple * inline stmt_vec_info
vect_dr_stmt (data_reference *dr) vect_dr_stmt (data_reference *dr)
{ {
gimple *stmt = DR_STMT (dr); gimple *stmt = DR_STMT (dr);
...@@ -1379,7 +1379,7 @@ vect_dr_stmt (data_reference *dr) ...@@ -1379,7 +1379,7 @@ vect_dr_stmt (data_reference *dr)
return STMT_VINFO_RELATED_STMT (stmt_info); return STMT_VINFO_RELATED_STMT (stmt_info);
/* DR_STMT should never refer to a stmt in a pattern replacement. */ /* DR_STMT should never refer to a stmt in a pattern replacement. */
gcc_checking_assert (!STMT_VINFO_RELATED_STMT (stmt_info)); gcc_checking_assert (!STMT_VINFO_RELATED_STMT (stmt_info));
return stmt; return stmt_info;
} }
/* Return true if the vect cost model is unlimited. */ /* Return true if the vect cost model is unlimited. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment