diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-18 15:55:22 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-19 16:09:01 +0200 |
commit | 93bd0213885739a1073f8c98911f8a00c0eb5597 (patch) | |
tree | 64e1e20c84b9ed5128131476933af6b6d2234d14 /gcc/tree-vect-stmts.c | |
parent | 5a8832b1659e311437d25b7ec8b078be27ae54b8 (diff) | |
download | gcc-93bd0213885739a1073f8c98911f8a00c0eb5597.zip gcc-93bd0213885739a1073f8c98911f8a00c0eb5597.tar.gz gcc-93bd0213885739a1073f8c98911f8a00c0eb5597.tar.bz2 |
Refactor vect_supportable_dr_alignment
This refactors vect_supportable_dr_alignment to get the misalignment
as input parameter which allows us to elide modifying/restoring
of DR_MISALIGNMENT during alignment peeling analysis which eventually
makes it more straight-forward to split out the negative step
handling.
2021-10-19 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (vect_supportable_dr_alignment): Add
misalignment parameter.
* tree-vect-data-refs.c (vect_get_peeling_costs_all_drs):
Do not change DR_MISALIGNMENT in place, instead pass the
adjusted misalignment to vect_supportable_dr_alignment.
(vect_peeling_supportable): Likewise.
(vect_peeling_hash_get_lowest_cost): Adjust.
(vect_enhance_data_refs_alignment): Likewise.
(vect_vfa_access_size): Likewise.
(vect_supportable_dr_alignment): Add misalignment
parameter and simplify.
* tree-vect-stmts.c (get_negative_load_store_type): Adjust.
(get_group_load_store_type): Likewise.
(get_load_store_type): Likewise.
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index afc3ef1..9cbc1af 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1986,8 +1986,9 @@ get_negative_load_store_type (vec_info *vinfo, return VMAT_ELEMENTWISE; } - alignment_support_scheme = vect_supportable_dr_alignment (vinfo, dr_info, - vectype); + int misalignment = dr_misalignment (dr_info, vectype); + alignment_support_scheme + = vect_supportable_dr_alignment (vinfo, dr_info, vectype, misalignment); if (alignment_support_scheme != dr_aligned && alignment_support_scheme != dr_unaligned_supported) { @@ -2184,15 +2185,15 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, can do half-vector operations avoid the epilogue peeling by simply loading half of the vector only. Usually the construction with an upper zero half will be elided. */ - dr_alignment_support alignment_support_scheme; + dr_alignment_support alss; + int misalign = dr_misalignment (first_dr_info, vectype); tree half_vtype; if (overrun_p && !masked_p - && (((alignment_support_scheme - = vect_supportable_dr_alignment (vinfo, first_dr_info, - vectype))) + && (((alss = vect_supportable_dr_alignment (vinfo, first_dr_info, + vectype, misalign))) == dr_aligned - || alignment_support_scheme == dr_unaligned_supported) + || alss == dr_unaligned_supported) && known_eq (nunits, (group_size - gap) * 2) && known_eq (nunits, group_size) && (vector_vector_composition_type (vectype, 2, &half_vtype) @@ -2304,9 +2305,10 @@ get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, } else { - *alignment_support_scheme - = vect_supportable_dr_alignment (vinfo, first_dr_info, vectype); *misalignment = dr_misalignment (first_dr_info, vectype); + *alignment_support_scheme + = vect_supportable_dr_alignment (vinfo, first_dr_info, vectype, + *misalignment); } if (vls_type != VLS_LOAD && first_stmt_info == stmt_info) @@ -2452,12 +2454,12 @@ get_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, (vinfo, stmt_info, vectype, vls_type, ncopies, poffset); else *memory_access_type = VMAT_CONTIGUOUS; + *misalignment = dr_misalignment (STMT_VINFO_DR_INFO (stmt_info), + vectype); *alignment_support_scheme = vect_supportable_dr_alignment (vinfo, STMT_VINFO_DR_INFO (stmt_info), - vectype); - *misalignment = dr_misalignment (STMT_VINFO_DR_INFO (stmt_info), - vectype); + vectype, *misalignment); } } |