diff options
author | Richard Biener <rguenther@suse.de> | 2021-01-15 14:20:43 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-01-15 15:07:43 +0100 |
commit | 446703ccc2ce09e9710964f781a21030bf3c2d54 (patch) | |
tree | 0480e330b41566cac5233685f672f32fb77817fa /gcc | |
parent | dc8475e3348405ce3113364746b64d029a05c343 (diff) | |
download | gcc-446703ccc2ce09e9710964f781a21030bf3c2d54.zip gcc-446703ccc2ce09e9710964f781a21030bf3c2d54.tar.gz gcc-446703ccc2ce09e9710964f781a21030bf3c2d54.tar.bz2 |
tree-optimization/96376 - do not check alignment for invariant loads
The testcases show that we fail to disregard alignment for invariant
loads. The patch handles them like we handle gather and scatter.
2021-01-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/96376
* tree-vect-stmts.c (get_load_store_type): Disregard alignment
for VMAT_INVARIANT.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-stmts.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 4d72c4d..f180ced 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -2378,19 +2378,26 @@ get_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info, else { int cmp = compare_step_with_zero (vinfo, stmt_info); - if (cmp < 0) - *memory_access_type = get_negative_load_store_type - (vinfo, stmt_info, vectype, vls_type, ncopies); - else if (cmp == 0) + if (cmp == 0) { gcc_assert (vls_type == VLS_LOAD); *memory_access_type = VMAT_INVARIANT; + /* Invariant accesses perform only component accesses, alignment + is irrelevant for them. */ + *alignment_support_scheme = dr_unaligned_supported; } else - *memory_access_type = VMAT_CONTIGUOUS; - *alignment_support_scheme - = vect_supportable_dr_alignment (vinfo, - STMT_VINFO_DR_INFO (stmt_info), false); + { + if (cmp < 0) + *memory_access_type = get_negative_load_store_type + (vinfo, stmt_info, vectype, vls_type, ncopies); + else + *memory_access_type = VMAT_CONTIGUOUS; + *alignment_support_scheme + = vect_supportable_dr_alignment (vinfo, + STMT_VINFO_DR_INFO (stmt_info), + false); + } } if ((*memory_access_type == VMAT_ELEMENTWISE |