From: Fei Yang Date: Sat, 13 Jun 2020 02:42:49 +0000 (+0800) Subject: vect: Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS consistently X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8df82de27b5f16d5089b135d718e9ed15557ae8d;p=gcc.git vect: Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS consistently Minor code refactorings in tree-vect-data-refs.c and tree-vect-loop.c. Use LOOP_VINFO_DATAREFS and LOOP_VINFO_DDRS when possible and rename several parameters to make code more consistent. 2020-06-13 Felix Yang gcc/ * tree-vect-data-refs.c (vect_verify_datarefs_alignment): Rename parameter to loop_vinfo and update uses. Use LOOP_VINFO_DATAREFS when possible. (vect_analyze_data_refs_alignment): Likewise, and use LOOP_VINFO_DDRS when possible. * tree-vect-loop.c (vect_dissolve_slp_only_groups): Use LOOP_VINFO_DATAREFS when possible. (update_epilogue_loop_vinfo): Likewise. --- diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 3e86980172e..4164bf4743c 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1189,19 +1189,19 @@ verify_data_ref_alignment (vec_info *vinfo, dr_vec_info *dr_info) handled with respect to alignment. */ opt_result -vect_verify_datarefs_alignment (loop_vec_info vinfo) +vect_verify_datarefs_alignment (loop_vec_info loop_vinfo) { - vec datarefs = vinfo->shared->datarefs; + vec datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); struct data_reference *dr; unsigned int i; FOR_EACH_VEC_ELT (datarefs, i, dr) { - dr_vec_info *dr_info = vinfo->lookup_dr (dr); + dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr); if (!vect_relevant_for_alignment_p (dr_info)) continue; - opt_result res = verify_data_ref_alignment (vinfo, dr_info); + opt_result res = verify_data_ref_alignment (loop_vinfo, dr_info); if (!res) return res; } @@ -2379,28 +2379,28 @@ vect_find_same_alignment_drs (vec_info *vinfo, data_dependence_relation *ddr) Return FALSE if a data reference is found that cannot be vectorized. */ opt_result -vect_analyze_data_refs_alignment (loop_vec_info vinfo) +vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo) { DUMP_VECT_SCOPE ("vect_analyze_data_refs_alignment"); /* Mark groups of data references with same alignment using data dependence information. */ - vec ddrs = vinfo->shared->ddrs; + vec ddrs = LOOP_VINFO_DDRS (loop_vinfo); struct data_dependence_relation *ddr; unsigned int i; FOR_EACH_VEC_ELT (ddrs, i, ddr) - vect_find_same_alignment_drs (vinfo, ddr); + vect_find_same_alignment_drs (loop_vinfo, ddr); - vec datarefs = vinfo->shared->datarefs; + vec datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); struct data_reference *dr; - vect_record_base_alignments (vinfo); + vect_record_base_alignments (loop_vinfo); FOR_EACH_VEC_ELT (datarefs, i, dr) { - dr_vec_info *dr_info = vinfo->lookup_dr (dr); + dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr); if (STMT_VINFO_VECTORIZABLE (dr_info->stmt)) - vect_compute_data_ref_alignment (vinfo, dr_info); + vect_compute_data_ref_alignment (loop_vinfo, dr_info); } return opt_result::success (); diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 6311e795204..08c9f119626 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1843,7 +1843,7 @@ vect_dissolve_slp_only_groups (loop_vec_info loop_vinfo) DUMP_VECT_SCOPE ("vect_dissolve_slp_only_groups"); - vec datarefs = loop_vinfo->shared->datarefs; + vec datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); FOR_EACH_VEC_ELT (datarefs, i, dr) { gcc_assert (DR_REF (dr)); @@ -8478,7 +8478,7 @@ update_epilogue_loop_vinfo (class loop *epilogue, tree advance) } struct data_reference *dr; - vec datarefs = epilogue_vinfo->shared->datarefs; + vec datarefs = LOOP_VINFO_DATAREFS (epilogue_vinfo); FOR_EACH_VEC_ELT (datarefs, i, dr) { orig_stmt = DR_STMT (dr);