public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/4] Fix SLP of emulated gathers
@ 2023-11-08 15:03 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-11-08 15:03 UTC (permalink / raw)
  To: gcc-patches

The following fixes an error in the SLP of emulated gathers,
discovered by x86 specific tests when enabling single-lane SLP.

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

	* tree-vect-stmts.cc (vectorizable_load): Adjust offset
	vector gathering for SLP of emulated gathers.
---
 gcc/tree-vect-stmts.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 61e23b29516..913a4fb08ed 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -11163,7 +11163,7 @@ vectorizable_load (vec_info *vinfo,
 		     than the data vector for now.  */
 		  unsigned HOST_WIDE_INT factor
 		    = const_offset_nunits / const_nunits;
-		  vec_offset = vec_offsets[j / factor];
+		  vec_offset = vec_offsets[(vec_num * j + i) / factor];
 		  unsigned elt_offset = (j % factor) * const_nunits;
 		  tree idx_type = TREE_TYPE (TREE_TYPE (vec_offset));
 		  tree scale = size_int (gs_info.scale);
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-08 15:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-08 15:03 [PATCH 3/4] Fix SLP of emulated gathers Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).