[37/46] dr_aux tweaks
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 31 Jul 2018 14:25:56 +0000 (14:25 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 31 Jul 2018 14:25:56 +0000 (14:25 +0000)
commitf44fb7aa84e0c1f9c0721a69f7b0f157d6058686
treee9f486becfeab0c0cdcdbefa678e6470f968fd88
parent634e7150449157267db1a1152370b11446acb6d0
[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
gcc/ChangeLog
gcc/tree-vect-data-refs.c
gcc/tree-vect-patterns.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.c
gcc/tree-vectorizer.h