]> git.ipfire.org Git - people/ms/gcc.git/commit
tree-optimization/107451 - SLP load vectorization issue
authorRichard Biener <rguenther@suse.de>
Thu, 22 Dec 2022 08:36:17 +0000 (09:36 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 09:05:08 +0000 (10:05 +0100)
commitc722c6b061a5e909267eae53ffe5910fbe0a7d5e
tree0e9a7322f7aedde83b7bd6f2bc5287ada58a4361
parent97d599e09b0fd389a7cbac8867e56977ec97900f
tree-optimization/107451 - SLP load vectorization issue

When vectorizing SLP loads with permutations we can access excess
elements when the load vector type is bigger than the group size
and the vectorization factor covers less groups than necessary
to fill it.  Since we know the code will only access up to
group_size * VF elements in the unpermuted vector we can simply
fill the rest of the vector with whatever we want.  For simplicity
this patch chooses to repeat the last group.

PR tree-optimization/107451
* tree-vect-stmts.cc (vectorizable_load): Avoid loading
SLP group members from group numbers in excess of the
vectorization factor.

* gcc.dg/torture/pr107451.c: New testcase.

(cherry picked from commit 7b2cf5041460859ca4f58e5da1308b7ef9129d8b)
gcc/testsuite/gcc.dg/torture/pr107451.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc