aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-11-21 09:14:53 +0100
committerRichard Biener <rguenth@gcc.gnu.org>2024-11-21 10:04:55 +0100
commit7e9b0d90d363311caaa5a5e6edbb5088afe0308f (patch)
treed26a4c0c613685b9ee4de8cd32a1d0d33a04ada5 /gcc
parentab8d3606bbe67bce8900931e8b2a03d24c2b8beb (diff)
downloadgcc-7e9b0d90d363311caaa5a5e6edbb5088afe0308f.zip
gcc-7e9b0d90d363311caaa5a5e6edbb5088afe0308f.tar.gz
gcc-7e9b0d90d363311caaa5a5e6edbb5088afe0308f.tar.bz2
tree-optimization/117720 - check alignment for VMAT_STRIDED_SLP
While vectorizable_store was already checking alignment requirement of the stores and fall back to elementwise accesses if not honored the vectorizable_load path wasn't doing this. After the previous change to disregard alignment checking for VMAT_STRIDED_SLP in get_group_load_store_type this now tripped on power. PR tree-optimization/117720 * tree-vect-stmts.cc (vectorizable_load): For VMAT_STRIDED_SLP verify the choosen load type is OK with regard to alignment.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 522e9f7..75973c7 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -10650,9 +10650,19 @@ vectorizable_load (vec_info *vinfo,
of it. */
if (n == const_nunits)
{
- nloads = 1;
- lnel = const_nunits;
- ltype = vectype;
+ int mis_align = dr_misalignment (first_dr_info, vectype);
+ dr_alignment_support dr_align
+ = vect_supportable_dr_alignment (vinfo, dr_info, vectype,
+ mis_align);
+ if (dr_align == dr_aligned
+ || dr_align == dr_unaligned_supported)
+ {
+ nloads = 1;
+ lnel = const_nunits;
+ ltype = vectype;
+ alignment_support_scheme = dr_align;
+ misalignment = mis_align;
+ }
}
/* Else use the biggest vector we can load the group without
accessing excess elements. */