diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:23:48 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:23:48 +0000 |
commit | 211ee39b9d1d7d670dd4885bd1f4f038680a1e90 (patch) | |
tree | 39cc3b566dd8b7db1122b5f3ec283ba082495f7c /gcc/tree-vect-loop.c | |
parent | 7bcbf2d83269394899f27695e19715dca8f098bf (diff) | |
download | gcc-211ee39b9d1d7d670dd4885bd1f4f038680a1e90.zip gcc-211ee39b9d1d7d670dd4885bd1f4f038680a1e90.tar.gz gcc-211ee39b9d1d7d670dd4885bd1f4f038680a1e90.tar.bz2 |
[24/46] Make stmt_info_for_cost use a stmt_vec_info
This patch makes stmt_info_for_cost carry a stmt_vec_info instead
of a gimple stmt. The structure is internal to the vectoriser,
so targets aren't affected.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (stmt_info_for_cost::stmt): Replace with...
(stmt_info_for_cost::stmt_info): ...this new field.
(add_stmt_costs): Update accordingly.
* tree-vect-loop.c (vect_compute_single_scalar_iteration_cost)
(vect_get_known_peeling_cost): Likewise.
(vect_estimate_min_profitable_iters): Likewise.
* tree-vect-stmts.c (record_stmt_cost): Likewise.
From-SVN: r263139
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 66 |
1 files changed, 20 insertions, 46 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index e611e99..f6b2b45 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1136,13 +1136,9 @@ vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo) int j; FOR_EACH_VEC_ELT (LOOP_VINFO_SCALAR_ITERATION_COST (loop_vinfo), j, si) - { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - (void) add_stmt_cost (target_cost_data, si->count, - si->kind, stmt_info, si->misalign, - vect_body); - } + (void) add_stmt_cost (target_cost_data, si->count, + si->kind, si->stmt_info, si->misalign, + vect_body); unsigned dummy, body_cost = 0; finish_cost (target_cost_data, &dummy, &body_cost, &dummy); destroy_cost_data (target_cost_data); @@ -3344,24 +3340,16 @@ vect_get_known_peeling_cost (loop_vec_info loop_vinfo, int peel_iters_prologue, int j; if (peel_iters_prologue) FOR_EACH_VEC_ELT (*scalar_cost_vec, j, si) - { - stmt_vec_info stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - retval += record_stmt_cost (prologue_cost_vec, - si->count * peel_iters_prologue, - si->kind, stmt_info, si->misalign, - vect_prologue); - } + retval += record_stmt_cost (prologue_cost_vec, + si->count * peel_iters_prologue, + si->kind, si->stmt_info, si->misalign, + vect_prologue); if (*peel_iters_epilogue) FOR_EACH_VEC_ELT (*scalar_cost_vec, j, si) - { - stmt_vec_info stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - retval += record_stmt_cost (epilogue_cost_vec, - si->count * *peel_iters_epilogue, - si->kind, stmt_info, si->misalign, - vect_epilogue); - } + retval += record_stmt_cost (epilogue_cost_vec, + si->count * *peel_iters_epilogue, + si->kind, si->stmt_info, si->misalign, + vect_epilogue); return retval; } @@ -3497,13 +3485,9 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, int j; FOR_EACH_VEC_ELT (LOOP_VINFO_SCALAR_ITERATION_COST (loop_vinfo), j, si) - { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - (void) add_stmt_cost (target_cost_data, si->count, - si->kind, stmt_info, si->misalign, - vect_epilogue); - } + (void) add_stmt_cost (target_cost_data, si->count, + si->kind, si->stmt_info, si->misalign, + vect_epilogue); } } else if (npeel < 0) @@ -3535,15 +3519,13 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, int j; FOR_EACH_VEC_ELT (LOOP_VINFO_SCALAR_ITERATION_COST (loop_vinfo), j, si) { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; (void) add_stmt_cost (target_cost_data, si->count * peel_iters_prologue, - si->kind, stmt_info, si->misalign, + si->kind, si->stmt_info, si->misalign, vect_prologue); (void) add_stmt_cost (target_cost_data, si->count * peel_iters_epilogue, - si->kind, stmt_info, si->misalign, + si->kind, si->stmt_info, si->misalign, vect_epilogue); } } @@ -3566,20 +3548,12 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, &epilogue_cost_vec); FOR_EACH_VEC_ELT (prologue_cost_vec, j, si) - { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - (void) add_stmt_cost (data, si->count, si->kind, stmt_info, - si->misalign, vect_prologue); - } + (void) add_stmt_cost (data, si->count, si->kind, si->stmt_info, + si->misalign, vect_prologue); FOR_EACH_VEC_ELT (epilogue_cost_vec, j, si) - { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL_STMT_VEC_INFO; - (void) add_stmt_cost (data, si->count, si->kind, stmt_info, - si->misalign, vect_epilogue); - } + (void) add_stmt_cost (data, si->count, si->kind, si->stmt_info, + si->misalign, vect_epilogue); prologue_cost_vec.release (); epilogue_cost_vec.release (); |