[37/46] dr_aux tweaks
commit5f02ee72ea77eabb1dad9675ce6944271c6a857b
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:25:56 +0000 (31 14:25 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:25:56 +0000 (31 14:25 +0000)
treee9f486becfeab0c0cdcdbefa678e6470f968fd88
parente05b01adf82d5c2e8fd90303af2a8f7c958060dd
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263152 138bc75d-0d04-0410-961f-82ee72b054a4
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