Commit 7bcbf2d8 by Richard Sandiford Committed by Richard Sandiford

[23/46] Make LOOP_VINFO_MAY_MISALIGN_STMTS use stmt_vec_info

This patch changes LOOP_VINFO_MAY_MISALIGN_STMTS from an
auto_vec<gimple *> to an auto_vec<stmt_vec_info>.

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

gcc/
	* tree-vectorizer.h (_loop_vec_info::may_misalign_stmts): Change
	from an auto_vec<gimple *> to an auto_vec<stmt_vec_info>.
	* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Update
	accordingly.
	* tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise.

From-SVN: r263138
parent c26228d4
2018-07-31 Richard Sandiford <richard.sandiford@arm.com> 2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (_loop_vec_info::may_misalign_stmts): Change
from an auto_vec<gimple *> to an auto_vec<stmt_vec_info>.
* tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Update
accordingly.
* tree-vect-loop-manip.c (vect_create_cond_for_align_checks): Likewise.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
* tree-vectorizer.h (_stmt_vec_info::same_dr_stmt): Change from * tree-vectorizer.h (_stmt_vec_info::same_dr_stmt): Change from
a gimple stmt to a stmt_vec_info. a gimple stmt to a stmt_vec_info.
* tree-vect-stmts.c (vectorizable_load): Update accordingly. * tree-vect-stmts.c (vectorizable_load): Update accordingly.
......
...@@ -2231,16 +2231,15 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) ...@@ -2231,16 +2231,15 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
if (do_versioning) if (do_versioning)
{ {
vec<gimple *> may_misalign_stmts vec<stmt_vec_info> may_misalign_stmts
= LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo); = LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo);
gimple *stmt; stmt_vec_info stmt_info;
/* It can now be assumed that the data references in the statements /* It can now be assumed that the data references in the statements
in LOOP_VINFO_MAY_MISALIGN_STMTS will be aligned in the version in LOOP_VINFO_MAY_MISALIGN_STMTS will be aligned in the version
of the loop being vectorized. */ of the loop being vectorized. */
FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt) FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt_info)
{ {
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
dr = STMT_VINFO_DATA_REF (stmt_info); dr = STMT_VINFO_DATA_REF (stmt_info);
SET_DR_MISALIGNMENT (dr, 0); SET_DR_MISALIGNMENT (dr, 0);
if (dump_enabled_p ()) if (dump_enabled_p ())
......
...@@ -2772,9 +2772,9 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo, ...@@ -2772,9 +2772,9 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
tree *cond_expr, tree *cond_expr,
gimple_seq *cond_expr_stmt_list) gimple_seq *cond_expr_stmt_list)
{ {
vec<gimple *> may_misalign_stmts vec<stmt_vec_info> may_misalign_stmts
= LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo); = LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo);
gimple *ref_stmt; stmt_vec_info stmt_info;
int mask = LOOP_VINFO_PTR_MASK (loop_vinfo); int mask = LOOP_VINFO_PTR_MASK (loop_vinfo);
tree mask_cst; tree mask_cst;
unsigned int i; unsigned int i;
...@@ -2795,23 +2795,22 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo, ...@@ -2795,23 +2795,22 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
/* Create expression (mask & (dr_1 || ... || dr_n)) where dr_i is the address /* Create expression (mask & (dr_1 || ... || dr_n)) where dr_i is the address
of the first vector of the i'th data reference. */ of the first vector of the i'th data reference. */
FOR_EACH_VEC_ELT (may_misalign_stmts, i, ref_stmt) FOR_EACH_VEC_ELT (may_misalign_stmts, i, stmt_info)
{ {
gimple_seq new_stmt_list = NULL; gimple_seq new_stmt_list = NULL;
tree addr_base; tree addr_base;
tree addr_tmp_name; tree addr_tmp_name;
tree new_or_tmp_name; tree new_or_tmp_name;
gimple *addr_stmt, *or_stmt; gimple *addr_stmt, *or_stmt;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (ref_stmt); tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
bool negative = tree_int_cst_compare bool negative = tree_int_cst_compare
(DR_STEP (STMT_VINFO_DATA_REF (stmt_vinfo)), size_zero_node) < 0; (DR_STEP (STMT_VINFO_DATA_REF (stmt_info)), size_zero_node) < 0;
tree offset = negative tree offset = negative
? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1) : size_zero_node; ? size_int (-TYPE_VECTOR_SUBPARTS (vectype) + 1) : size_zero_node;
/* create: addr_tmp = (int)(address_of_first_vector) */ /* create: addr_tmp = (int)(address_of_first_vector) */
addr_base = addr_base =
vect_create_addr_base_for_vector_ref (ref_stmt, &new_stmt_list, vect_create_addr_base_for_vector_ref (stmt_info, &new_stmt_list,
offset); offset);
if (new_stmt_list != NULL) if (new_stmt_list != NULL)
gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list); gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list);
......
...@@ -472,7 +472,7 @@ typedef struct _loop_vec_info : public vec_info { ...@@ -472,7 +472,7 @@ typedef struct _loop_vec_info : public vec_info {
/* Statements in the loop that have data references that are candidates for a /* Statements in the loop that have data references that are candidates for a
runtime (loop versioning) misalignment check. */ runtime (loop versioning) misalignment check. */
auto_vec<gimple *> may_misalign_stmts; auto_vec<stmt_vec_info> may_misalign_stmts;
/* Reduction cycles detected in the loop. Used in loop-aware SLP. */ /* Reduction cycles detected in the loop. Used in loop-aware SLP. */
auto_vec<stmt_vec_info> reductions; auto_vec<stmt_vec_info> reductions;
......
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