diff options
author | Kewen Lin <linkw@gcc.gnu.org> | 2020-06-04 13:57:19 +0800 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2020-06-11 03:35:30 -0500 |
commit | 37478789dc446a28ffc642ee121e8c3959e5fe47 (patch) | |
tree | 2a9d870f00773515e70060943943eb72f9bb18c6 /gcc/tree-vect-loop.c | |
parent | b3372425ecf3e225d7a2b3c73e061e11498b6f74 (diff) | |
download | gcc-37478789dc446a28ffc642ee121e8c3959e5fe47.zip gcc-37478789dc446a28ffc642ee121e8c3959e5fe47.tar.gz gcc-37478789dc446a28ffc642ee121e8c3959e5fe47.tar.bz2 |
vect: Rename things related to rgroup_masks
Power supports vector memory access with length (in bytes) instructions.
Like existing fully masking for SVE, it is another approach to vectorize
the loop using partially-populated vectors.
As Richard Sandiford pointed out, we can rename the rgroup struct
rgroup_masks to rgroup_controls, rename its members mask_type to type,
masks to controls to be more generic.
Besides, this patch also renames some functions like vect_set_loop_mask
to vect_set_loop_control, release_vec_loop_masks to
release_vec_loop_controls, vect_set_loop_masks_directly to
vect_set_loop_controls_directly.
Bootstrapped/regtested on aarch64-linux-gnu.
gcc/ChangeLog:
* tree-vect-loop-manip.c (vect_set_loop_mask): Renamed to ...
(vect_set_loop_control): ... this.
(vect_maybe_permute_loop_masks): Rename rgroup_masks related things.
(vect_set_loop_masks_directly): Renamed to ...
(vect_set_loop_controls_directly): ... this. Also rename some
variables with ctrl instead of mask. Rename vect_set_loop_mask to
vect_set_loop_control.
(vect_set_loop_condition_masked): Rename rgroup_masks related things.
Also rename some variables with ctrl instead of mask.
* tree-vect-loop.c (release_vec_loop_masks): Renamed to ...
(release_vec_loop_controls): ... this. Rename rgroup_masks related
things.
(_loop_vec_info::~_loop_vec_info): Rename release_vec_loop_masks to
release_vec_loop_controls.
(can_produce_all_loop_masks_p): Rename rgroup_masks related things.
(vect_get_max_nscalars_per_iter): Likewise.
(vect_estimate_min_profitable_iters): Likewise.
(vect_record_loop_mask): Likewise.
(vect_get_loop_mask): Likewise.
* tree-vectorizer.h (struct rgroup_masks): Renamed to ...
(struct rgroup_controls): ... this. Also rename mask_type
to type and rename masks to controls.
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a9a32e55..f4d47e0 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -878,16 +878,16 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *shared) epilogue_vinfos.create (6); } -/* Free all levels of MASKS. */ +/* Free all levels of rgroup CONTROLS. */ void -release_vec_loop_masks (vec_loop_masks *masks) +release_vec_loop_controls (vec<rgroup_controls> *controls) { - rgroup_masks *rgm; + rgroup_controls *rgc; unsigned int i; - FOR_EACH_VEC_ELT (*masks, i, rgm) - rgm->masks.release (); - masks->release (); + FOR_EACH_VEC_ELT (*controls, i, rgc) + rgc->controls.release (); + controls->release (); } /* Free all memory used by the _loop_vec_info, as well as all the @@ -897,7 +897,7 @@ _loop_vec_info::~_loop_vec_info () { free (bbs); - release_vec_loop_masks (&masks); + release_vec_loop_controls (&masks); delete ivexpr_map; delete scan_map; epilogue_vinfos.release (); @@ -938,12 +938,12 @@ cse_and_gimplify_to_preheader (loop_vec_info loop_vinfo, tree expr) static bool can_produce_all_loop_masks_p (loop_vec_info loop_vinfo, tree cmp_type) { - rgroup_masks *rgm; + rgroup_controls *rgm; unsigned int i; FOR_EACH_VEC_ELT (LOOP_VINFO_MASKS (loop_vinfo), i, rgm) - if (rgm->mask_type != NULL_TREE + if (rgm->type != NULL_TREE && !direct_internal_fn_supported_p (IFN_WHILE_ULT, - cmp_type, rgm->mask_type, + cmp_type, rgm->type, OPTIMIZE_FOR_SPEED)) return false; return true; @@ -957,7 +957,7 @@ vect_get_max_nscalars_per_iter (loop_vec_info loop_vinfo) { unsigned int res = 1; unsigned int i; - rgroup_masks *rgm; + rgroup_controls *rgm; FOR_EACH_VEC_ELT (LOOP_VINFO_MASKS (loop_vinfo), i, rgm) res = MAX (res, rgm->max_nscalars_per_iter); return res; @@ -2379,7 +2379,7 @@ again: LOOP_VINFO_TARGET_COST_DATA (loop_vinfo) = init_cost (LOOP_VINFO_LOOP (loop_vinfo)); /* Reset accumulated rgroup information. */ - release_vec_loop_masks (&LOOP_VINFO_MASKS (loop_vinfo)); + release_vec_loop_controls (&LOOP_VINFO_MASKS (loop_vinfo)); /* Reset assorted flags. */ LOOP_VINFO_PEELING_FOR_NITER (loop_vinfo) = false; LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo) = false; @@ -3512,10 +3512,10 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, /* Calculate how many masks we need to generate. */ unsigned int num_masks = 0; - rgroup_masks *rgm; + rgroup_controls *rgm; unsigned int num_vectors_m1; FOR_EACH_VEC_ELT (LOOP_VINFO_MASKS (loop_vinfo), num_vectors_m1, rgm) - if (rgm->mask_type) + if (rgm->type) num_masks += num_vectors_m1 + 1; gcc_assert (num_masks > 0); @@ -8153,7 +8153,7 @@ vect_record_loop_mask (loop_vec_info loop_vinfo, vec_loop_masks *masks, gcc_assert (nvectors != 0); if (masks->length () < nvectors) masks->safe_grow_cleared (nvectors); - rgroup_masks *rgm = &(*masks)[nvectors - 1]; + rgroup_controls *rgm = &(*masks)[nvectors - 1]; /* The number of scalars per iteration and the number of vectors are both compile-time constants. */ unsigned int nscalars_per_iter @@ -8169,7 +8169,7 @@ vect_record_loop_mask (loop_vec_info loop_vinfo, vec_loop_masks *masks, if (rgm->max_nscalars_per_iter < nscalars_per_iter) { rgm->max_nscalars_per_iter = nscalars_per_iter; - rgm->mask_type = truth_type_for (vectype); + rgm->type = truth_type_for (vectype); } } @@ -8184,24 +8184,24 @@ tree vect_get_loop_mask (gimple_stmt_iterator *gsi, vec_loop_masks *masks, unsigned int nvectors, tree vectype, unsigned int index) { - rgroup_masks *rgm = &(*masks)[nvectors - 1]; - tree mask_type = rgm->mask_type; + rgroup_controls *rgm = &(*masks)[nvectors - 1]; + tree mask_type = rgm->type; /* Populate the rgroup's mask array, if this is the first time we've used it. */ - if (rgm->masks.is_empty ()) + if (rgm->controls.is_empty ()) { - rgm->masks.safe_grow_cleared (nvectors); + rgm->controls.safe_grow_cleared (nvectors); for (unsigned int i = 0; i < nvectors; ++i) { tree mask = make_temp_ssa_name (mask_type, NULL, "loop_mask"); /* Provide a dummy definition until the real one is available. */ SSA_NAME_DEF_STMT (mask) = gimple_build_nop (); - rgm->masks[i] = mask; + rgm->controls[i] = mask; } } - tree mask = rgm->masks[index]; + tree mask = rgm->controls[index]; if (maybe_ne (TYPE_VECTOR_SUBPARTS (mask_type), TYPE_VECTOR_SUBPARTS (vectype))) { |