aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorKewen Lin <linkw@gcc.gnu.org>2020-06-04 13:57:19 +0800
committerKewen Lin <linkw@linux.ibm.com>2020-06-11 03:35:30 -0500
commit37478789dc446a28ffc642ee121e8c3959e5fe47 (patch)
tree2a9d870f00773515e70060943943eb72f9bb18c6 /gcc/tree-vectorizer.h
parentb3372425ecf3e225d7a2b3c73e061e11498b6f74 (diff)
downloadgcc-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-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h48
1 files changed, 25 insertions, 23 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 9be4d15..828a541 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -390,7 +390,6 @@ is_a_helper <_bb_vec_info *>::test (vec_info *i)
return i->kind == vec_info::bb;
}
-
/* In general, we can divide the vector statements in a vectorized loop
into related groups ("rgroups") and say that for each rgroup there is
some nS such that the rgroup operates on nS values from one scalar
@@ -420,19 +419,21 @@ is_a_helper <_bb_vec_info *>::test (vec_info *i)
In classical vectorization, each iteration of the vector loop would
handle exactly VF iterations of the original scalar loop. However,
- in a fully-masked loop, a particular iteration of the vector loop
- might handle fewer than VF iterations of the scalar loop. The vector
- lanes that correspond to iterations of the scalar loop are said to be
- "active" and the other lanes are said to be "inactive".
-
- In a fully-masked loop, many rgroups need to be masked to ensure that
- they have no effect for the inactive lanes. Each such rgroup needs a
- sequence of booleans in the same order as above, but with each (i,j)
- replaced by a boolean that indicates whether iteration i is active.
- This sequence occupies nV vector masks that again have nL lanes each.
- Thus the mask sequence as a whole consists of VF independent booleans
- that are each repeated nS times.
-
+ in vector loops that are able to operate on partial vectors, a
+ particular iteration of the vector loop might handle fewer than VF
+ iterations of the scalar loop. The vector lanes that correspond to
+ iterations of the scalar loop are said to be "active" and the other
+ lanes are said to be "inactive".
+
+ In such vector loops, many rgroups need to be controlled to ensure
+ that they have no effect for the inactive lanes. Conceptually, each
+ such rgroup needs a sequence of booleans in the same order as above,
+ but with each (i,j) replaced by a boolean that indicates whether
+ iteration i is active. This sequence occupies nV vector controls
+ that again have nL lanes each. Thus the control sequence as a whole
+ consists of VF independent booleans that are each repeated nS times.
+
+ Taking mask-based approach as a partially-populated vectors example.
We make the simplifying assumption that if a sequence of nV masks is
suitable for one (nS,nL) pair, we can reuse it for (nS/2,nL/2) by
VIEW_CONVERTing it. This holds for all current targets that support
@@ -472,20 +473,21 @@ is_a_helper <_bb_vec_info *>::test (vec_info *i)
first level being indexed by nV - 1 (since nV == 0 doesn't exist) and
the second being indexed by the mask index 0 <= i < nV. */
-/* The masks needed by rgroups with nV vectors, according to the
- description above. */
-struct rgroup_masks {
- /* The largest nS for all rgroups that use these masks. */
+/* The controls (like masks) needed by rgroups with nV vectors,
+ according to the description above. */
+struct rgroup_controls {
+ /* The largest nS for all rgroups that use these controls. */
unsigned int max_nscalars_per_iter;
- /* The type of mask to use, based on the highest nS recorded above. */
- tree mask_type;
+ /* The type of control to use, based on the highest nS recorded above.
+ For mask-based approach, it's used for mask_type. */
+ tree type;
- /* A vector of nV masks, in iteration order. */
- vec<tree> masks;
+ /* A vector of nV controls, in iteration order. */
+ vec<tree> controls;
};
-typedef auto_vec<rgroup_masks> vec_loop_masks;
+typedef auto_vec<rgroup_controls> vec_loop_masks;
typedef auto_vec<std::pair<data_reference*, tree> > drs_init_vec;