diff mbox series

Fix bogus SLP nvector compute in check_load_store_for_partial_vectors

Message ID 20240924085559.E8C983858D26@sourceware.org
State New
Headers show
Series Fix bogus SLP nvector compute in check_load_store_for_partial_vectors | expand

Commit Message

Richard Biener Sept. 24, 2024, 8:55 a.m. UTC
We have a new overload for vect_get_num_copies that handles both
SLP and non-SLP.  Use it.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

	* tree-vect-stmts.cc (check_load_store_for_partial_vectors):
	Use the new vect_get_num_copies overload.
---
 gcc/tree-vect-stmts.cc | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index cafcedb7b9e..f7867c0803b 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -1507,13 +1507,7 @@  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);