diff options
author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2020-01-10 13:33:10 +0000 |
---|---|---|
committer | Andre Vieira <avieira@gcc.gnu.org> | 2020-01-10 13:33:10 +0000 |
commit | 67723321fb917e94acf5844c2524ca3d9655ff7b (patch) | |
tree | 0806370357ddf99d3d69bf501bd92a197b18ff8f /gcc/tree-vect-loop-manip.c | |
parent | 6b412bf65c0947d589d0eaf6348f29e24cda01c9 (diff) | |
download | gcc-67723321fb917e94acf5844c2524ca3d9655ff7b.zip gcc-67723321fb917e94acf5844c2524ca3d9655ff7b.tar.gz gcc-67723321fb917e94acf5844c2524ca3d9655ff7b.tar.bz2 |
[vect] Keep track of DR_OFFSET advance in dr_vec_info rather than data_reference
gcc/ChangeLog:
2020-01-10 Andre Vieira <andre.simoesdiasvieira@arm.com>
* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Use
get_dr_vinfo_offset
* tree-vect-loop.c (update_epilogue_loop_vinfo): Remove orig_drs_init
parameter and its use to reset DR_OFFSET's.
(vect_transform_loop): Remove orig_drs_init argument.
* tree-vect-loop-manip.c (vect_update_init_of_dr): Update the offset
member of dr_vec_info rather than the offset of the associated
data_reference's innermost_loop_behavior.
(vect_update_init_of_dr): Pass dr_vec_info instead of data_reference.
(vect_do_peeling): Remove orig_drs_init parameter and its construction.
* tree-vect-stmts.c (check_scan_store): Replace use of DR_OFFSET with
get_dr_vinfo_offset.
(vectorizable_store): Likewise.
(vectorizable_load): Likewise.
From-SVN: r280107
Diffstat (limited to 'gcc/tree-vect-loop-manip.c')
-rw-r--r-- | gcc/tree-vect-loop-manip.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index ead8354..52ca4e3 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1716,19 +1716,22 @@ vect_gen_prolog_loop_niters (loop_vec_info loop_vinfo, iterations before the scalar one (using masking to skip inactive elements). This function updates the information recorded in DR to account for the difference. Specifically, it updates the OFFSET - field of DR. */ + field of DR_INFO. */ static void -vect_update_init_of_dr (struct data_reference *dr, tree niters, tree_code code) +vect_update_init_of_dr (dr_vec_info *dr_info, tree niters, tree_code code) { - tree offset = DR_OFFSET (dr); + struct data_reference *dr = dr_info->dr; + tree offset = dr_info->offset; + if (!offset) + offset = build_zero_cst (sizetype); niters = fold_build2 (MULT_EXPR, sizetype, fold_convert (sizetype, niters), fold_convert (sizetype, DR_STEP (dr))); offset = fold_build2 (code, sizetype, fold_convert (sizetype, offset), niters); - DR_OFFSET (dr) = offset; + dr_info->offset = offset; } @@ -1758,7 +1761,7 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters, { dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr); if (!STMT_VINFO_GATHER_SCATTER_P (dr_info->stmt)) - vect_update_init_of_dr (dr, niters, code); + vect_update_init_of_dr (dr_info, niters, code); } } @@ -2446,7 +2449,7 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, tree *niters_vector, tree *step_vector, tree *niters_vector_mult_vf_var, int th, bool check_profitability, bool niters_no_overflow, - tree *advance, drs_init_vec &orig_drs_init) + tree *advance) { edge e, guard_e; tree type = TREE_TYPE (niters), guard_cond; @@ -2694,14 +2697,6 @@ vect_do_peeling (loop_vec_info loop_vinfo, tree niters, tree nitersm1, scale_loop_profile (prolog, prob_prolog, bound_prolog); } - /* Save original inits for each data_reference before advancing them with - NITERS_PROLOG. */ - unsigned int i; - struct data_reference *dr; - vec<data_reference_p> datarefs = loop_vinfo->shared->datarefs; - FOR_EACH_VEC_ELT (datarefs, i, dr) - orig_drs_init.safe_push (std::make_pair (dr, DR_OFFSET (dr))); - /* Update init address of DRs. */ vect_update_inits_of_drs (loop_vinfo, niters_prolog, PLUS_EXPR); /* Update niters for vector loop. */ |