diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-25 13:39:07 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-26 12:29:48 +0200 |
commit | 94f28340513753ba94ab483e93ce1d096842a5ad (patch) | |
tree | 5003f5167c34608c17e64b23298438c50a57a2ed /gcc/tree-vectorizer.h | |
parent | 54e4e1769e44b925c35c0ffc11723027ff855bd7 (diff) | |
download | gcc-94f28340513753ba94ab483e93ce1d096842a5ad.zip gcc-94f28340513753ba94ab483e93ce1d096842a5ad.tar.gz gcc-94f28340513753ba94ab483e93ce1d096842a5ad.tar.bz2 |
Move negative stride bias out of dr_misalignment
This moves applying of a bias for negative stride accesses out of
dr_misalignment in favor of a more general optional offset argument.
The negative bias is now computed by get_load_store_type and applied
accordingly to determine the alignment support scheme. Likewise
the peeling/versioning code is adjusted albeit that still assumes
we'll end up with VMAT_CONTIGUOUS_DOWN or VMAT_CONTIGUOUS_REVERSE
but at least when not so (VMAT_STRIDED_SLP is one possibility) then
get_load_store_type will _not_ falsely report an aligned access but
instead an access with known misalignment.
This fixes PR96109.
2021-10-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/96109
* tree-vectorizer.h (dr_misalignment): Add optional offset
parameter.
* tree-vect-data-refs.c (dr_misalignment): Likewise. Remove
offset applied for negative stride accesses.
(vect_enhance_data_refs_alignment): Compute negative stride
access offset and pass it to dr_misalignment.
* tree-vect-stmts.c (get_negative_load_store_type): Pass
negative offset to dr_misalignment.
(get_group_load_store_type): Likewise.
(get_load_store_type): Likewise.
(vectorizable_store): Remove asserts about alignment.
(vectorizable_load): Likewise.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r-- | gcc/tree-vectorizer.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 866d813..52cdfbf 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -1606,7 +1606,8 @@ set_dr_misalignment (dr_vec_info *dr_info, int val) dr_info->misalignment = val; } -extern int dr_misalignment (dr_vec_info *dr_info, tree vectype); +extern int dr_misalignment (dr_vec_info *dr_info, tree vectype, + poly_int64 offset = 0); #define SET_DR_MISALIGNMENT(DR, VAL) set_dr_misalignment (DR, VAL) |