diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2018-07-31 14:25:56 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-07-31 14:25:56 +0000 |
commit | f44fb7aa84e0c1f9c0721a69f7b0f157d6058686 (patch) | |
tree | e9f486becfeab0c0cdcdbefa678e6470f968fd88 /gcc/tree-vect-data-refs.c | |
parent | 634e7150449157267db1a1152370b11446acb6d0 (diff) | |
download | gcc-f44fb7aa84e0c1f9c0721a69f7b0f157d6058686.zip gcc-f44fb7aa84e0c1f9c0721a69f7b0f157d6058686.tar.gz gcc-f44fb7aa84e0c1f9c0721a69f7b0f157d6058686.tar.bz2 |
[37/46] dr_aux tweaks
This patch makes dr_aux link back to both the scalar data_reference
and the containing stmt_vec_info, so that it becomes a suitable key
for a vectorisable reference.
The data_reference link is just STMT_VINFO_DATA_REF, moved here
from _stmt_vec_info. The stmt pointer is a new field and always
tracks the current stmt_vec_info for the reference (which might
be a pattern stmt or the original stmt).
The patch also makes the dr_aux in this current stmt be the one
that counts, rather than have the information stay with the DR_STMT.
A new macro (STMT_VINFO_DR_INFO) gives this information for a given
stmt_info.
In future we could make dr_aux a separate structure, which would
be useful if we want to support multiple data references per stmt.
That seems too much of a diversion for this series though.
2018-07-31 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-vectorizer.h (vec_info::move_dr): New member function.
(dataref_aux): Rename to...
(dr_vec_info): ...this and add "dr" and "stmt" fields.
(_stmt_vec_info::dr_aux): Update accordingly.
(_stmt_vec_info::data_ref_info): Delete.
(STMT_VINFO_GROUPED_ACCESS, DR_GROUP_FIRST_ELEMENT)
(DR_GROUP_NEXT_ELEMENT, DR_GROUP_SIZE, DR_GROUP_STORE_COUNT)
(DR_GROUP_GAP, DR_GROUP_SAME_DR_STMT, REDUC_GROUP_FIRST_ELEMENT):
(REDUC_GROUP_NEXT_ELEMENT, REDUC_GROUP_SIZE): Use dr_aux.dr instead
of data_ref.
(STMT_VINFO_DATA_REF): Likewise. Turn into an lvalue.
(STMT_VINFO_DR_INFO): New macro.
(DR_VECT_AUX): Use STMT_VINFO_DR_INKFO and vect_dr_stmt.
(set_dr_misalignment): Update after rename of dataref_aux.
(vect_dr_stmt): Move earlier in file. Return dr_aux.stmt.
* tree-vect-stmts.c (new_stmt_vec_info): Remove redundant
initialization of STMT_VINFO_DATA_REF.
* tree-vectorizer.c (vec_info::move_dr): New function.
* tree-vect-patterns.c (vect_recog_bool_pattern)
(vect_recog_mask_conversion_pattern)
(vect_recog_gather_scatter_pattern): Use it.
* tree-vect-data-refs.c (vect_analyze_data_refs): Initialize
the "dr" and "stmt" fields of dr_vec_info instead of
STMT_VINFO_DATA_REF.
From-SVN: r263152
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index f3cf440..f1f80a8 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -4120,7 +4120,10 @@ vect_analyze_data_refs (vec_info *vinfo, poly_uint64 *min_vf) poly_uint64 vf; gcc_assert (DR_REF (dr)); - stmt_vec_info stmt_info = vect_dr_stmt (dr); + stmt_vec_info stmt_info = vinfo->lookup_stmt (DR_STMT (dr)); + gcc_assert (!stmt_info->dr_aux.dr); + stmt_info->dr_aux.dr = dr; + stmt_info->dr_aux.stmt = stmt_info; /* Check that analysis of the data-ref succeeded. */ if (!DR_BASE_ADDRESS (dr) || !DR_OFFSET (dr) || !DR_INIT (dr) @@ -4292,9 +4295,6 @@ vect_analyze_data_refs (vec_info *vinfo, poly_uint64 *min_vf) } } - gcc_assert (!STMT_VINFO_DATA_REF (stmt_info)); - STMT_VINFO_DATA_REF (stmt_info) = dr; - /* Set vectype for STMT. */ scalar_type = TREE_TYPE (DR_REF (dr)); STMT_VINFO_VECTYPE (stmt_info) |