aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFei Yang <felix.yang@huawei.com>2020-06-18 20:11:09 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:14:03 -0300
commit3a7eb528563647cde968ee310eee8fe08cb7ae0b (patch)
treedad51afd5885b98bb674634941262e10c870d0bf /gcc
parentc1f0ed3b9c82577658e22323060306f8471491c9 (diff)
downloadgcc-3a7eb528563647cde968ee310eee8fe08cb7ae0b.zip
gcc-3a7eb528563647cde968ee310eee8fe08cb7ae0b.tar.gz
gcc-3a7eb528563647cde968ee310eee8fe08cb7ae0b.tar.bz2
vect: Use vect_relevant_for_alignment_p consistently
Minor code refactorings in tree-vect-data-refs.c. When trying loop peeling to force alignment, call vect_relevant_for_alignment_p to filter out data references in the loop whose alignment is irrelevant. 2020-06-18 Felix Yang <felix.yang@huawei.com> gcc/ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Call vect_relevant_for_alignment_p to filter out data references in the loop whose alignment is irrelevant when trying loop peeling to force alignment.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-data-refs.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 4164bf4..2365a39 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1722,29 +1722,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
FOR_EACH_VEC_ELT (datarefs, i, dr)
{
dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr);
- stmt_vec_info stmt_info = dr_info->stmt;
-
- if (!STMT_VINFO_RELEVANT_P (stmt_info))
- continue;
-
- /* For interleaving, only the alignment of the first access
- matters. */
- if (STMT_VINFO_GROUPED_ACCESS (stmt_info)
- && DR_GROUP_FIRST_ELEMENT (stmt_info) != stmt_info)
- continue;
-
- /* For scatter-gather or invariant accesses there is nothing
- to enhance. */
- if (STMT_VINFO_GATHER_SCATTER_P (stmt_info)
- || integer_zerop (DR_STEP (dr)))
- continue;
-
- /* Strided accesses perform only component accesses, alignment is
- irrelevant for them. */
- if (STMT_VINFO_STRIDED_P (stmt_info)
- && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ if (!vect_relevant_for_alignment_p (dr_info))
continue;
+ stmt_vec_info stmt_info = dr_info->stmt;
supportable_dr_alignment
= vect_supportable_dr_alignment (loop_vinfo, dr_info, true);
do_peeling = vector_alignment_reachable_p (dr_info);
@@ -2136,12 +2117,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
FOR_EACH_VEC_ELT (datarefs, i, dr)
if (dr != dr0_info->dr)
{
- /* Strided accesses perform only component accesses, alignment
- is irrelevant for them. */
dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr);
- stmt_info = dr_info->stmt;
- if (STMT_VINFO_STRIDED_P (stmt_info)
- && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ if (!vect_relevant_for_alignment_p (dr_info))
continue;
vect_update_misalignment_for_peel (dr_info, dr0_info, npeel);