aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-09-24 10:42:01 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-09-27 09:20:24 +0200
commit3db9e99165968af8479468cd373990da2f116e3b (patch)
tree71f6a1cd29648cccd9add3af0071bf87f4c1fa47 /gcc
parent9c04112fdc221b0a337f88572dfef4caaca78349 (diff)
downloadgcc-3db9e99165968af8479468cd373990da2f116e3b.zip
gcc-3db9e99165968af8479468cd373990da2f116e3b.tar.gz
gcc-3db9e99165968af8479468cd373990da2f116e3b.tar.bz2
Fix bogus SLP nvector compute in check_load_store_for_partial_vectors
We have a new overload for vect_get_num_copies that handles both SLP and non-SLP. Use it and avoid the division by group_size for SLP when not using load-store lanes. * tree-vect-stmts.cc (check_load_store_for_partial_vectors): Use the new vect_get_num_copies overload. Only divide by group_size for SLP for load-store lanes.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 1b351c5..a8031b4 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -1507,19 +1507,15 @@ check_load_store_for_partial_vectors (loop_vec_info loop_vinfo, tree vectype,
if (memory_access_type == VMAT_INVARIANT)
return;
- unsigned int nvectors;
- if (slp_node)
- /* ??? Incorrect for multi-lane lanes. */
- nvectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node) / group_size;
- else
- nvectors = vect_get_num_copies (loop_vinfo, vectype);
-
+ unsigned int nvectors = vect_get_num_copies (loop_vinfo, slp_node, vectype);
vec_loop_masks *masks = &LOOP_VINFO_MASKS (loop_vinfo);
vec_loop_lens *lens = &LOOP_VINFO_LENS (loop_vinfo);
machine_mode vecmode = TYPE_MODE (vectype);
bool is_load = (vls_type == VLS_LOAD);
if (memory_access_type == VMAT_LOAD_STORE_LANES)
{
+ if (slp_node)
+ nvectors /= group_size;
internal_fn ifn
= (is_load ? vect_load_lanes_supported (vectype, group_size, true)
: vect_store_lanes_supported (vectype, group_size, true));