diff mbox series

tree-optimization/117502 - VMAT_STRIDED_SLP vs VMAT_ELEMENTWISE when considering gather

Message ID 20241108120901.5FC4C13967@imap1.dmz-prg2.suse.org
State New
Headers show
Series tree-optimization/117502 - VMAT_STRIDED_SLP vs VMAT_ELEMENTWISE when considering gather | expand

Commit Message

Richard Biener Nov. 8, 2024, 12:09 p.m. UTC
The following treats both the same when considering to use gather or
scatter for single-element interleaving accesses.

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

	PR tree-optimization/117502
	* tree-vect-stmts.cc (get_group_load_store_type): Also consider
	VMAT_STRIDED_SLP when checking to use gather/scatter for
	single-element interleaving access.
---
 gcc/tree-vect-stmts.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 9a2c2ea753e..28bfd8f4e28 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -2274,7 +2274,8 @@  get_group_load_store_type (vec_info *vinfo, stmt_vec_info stmt_info,
      on nearby locations.  Or, even if it's a win over scalar code,
      it might not be a win over vectorizing at a lower VF, if that
      allows us to use contiguous accesses.  */
-  if (*memory_access_type == VMAT_ELEMENTWISE
+  if ((*memory_access_type == VMAT_ELEMENTWISE
+       || *memory_access_type == VMAT_STRIDED_SLP)
       && single_element_p
       && loop_vinfo
       && vect_use_strided_gather_scatters_p (stmt_info, loop_vinfo,