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-vectorizer.h | |
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-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 68cf96f..58c1232 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -910,6 +910,10 @@ public: /* If true the alignment of base_decl needs to be increased. */ bool base_misaligned; tree base_decl; + + /* Stores current vectorized loop's offset. To be added to the DR's + offset to calculate current offset of data reference. */ + tree offset; }; typedef struct data_reference *dr_p; @@ -1485,6 +1489,26 @@ vect_dr_behavior (dr_vec_info *dr_info) return &STMT_VINFO_DR_WRT_VEC_LOOP (stmt_info); } +inline tree +get_dr_vinfo_offset (dr_vec_info *dr_info, bool check_outer = false) +{ + innermost_loop_behavior *base; + if (check_outer) + base = vect_dr_behavior (dr_info); + else + base = &dr_info->dr->innermost; + + tree offset = base->offset; + + if (!dr_info->offset) + return offset; + + offset = fold_convert (sizetype, offset); + return fold_build2 (PLUS_EXPR, TREE_TYPE (dr_info->offset), offset, + dr_info->offset); +} + + /* Return true if the vect cost model is unlimited. */ static inline bool unlimited_cost_model (loop_p loop) @@ -1655,7 +1679,7 @@ class loop *slpeel_tree_duplicate_loop_to_edge_cfg (class loop *, class loop *vect_loop_versioning (loop_vec_info); extern class loop *vect_do_peeling (loop_vec_info, tree, tree, tree *, tree *, tree *, int, bool, bool, - tree *, drs_init_vec &); + tree *); extern void vect_prepare_for_masked_peels (loop_vec_info); extern dump_user_location_t find_loop_location (class loop *); extern bool vect_can_advance_ivs_p (loop_vec_info); |