]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/103116 - SLP permutes and peeling for gaps
authorRichard Biener <rguenther@suse.de>
Wed, 4 May 2022 08:43:07 +0000 (10:43 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 20 May 2022 06:00:28 +0000 (08:00 +0200)
commitfdf50499a40399a48ac5e5d521ef93ed302be157
tree286d9d1df9f9eaa952d001017abb8f1425c8980d
parentf682c64377e4dc72c858b1481c692fd280697209
tree-optimization/103116 - SLP permutes and peeling for gaps

The testcase shows that we can end up with a contiguous access across
loop iterations but by means of permutations the elements accessed
might only cover parts of a vector.  In this case we end up with
GROUP_GAP == 0 but still need to avoid accessing excess elements
in the last loop iterations.  Peeling for gaps is designed to cover
this but a single scalar iteration might not cover all of the excess
elements.  The following ensures peeling for gaps is done in this
situation and when that isn't sufficient because we need to peel
more than one iteration (gcc.dg/vect/pr103116-2.c), fail the SLP
vectorization.

2022-05-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/103116
* tree-vect-stmts.cc (get_group_load_store_type): Handle the
case we need peeling for gaps even though GROUP_GAP is zero.

* gcc.dg/vect/pr103116-1.c: New testcase.
* gcc.dg/vect/pr103116-2.c: Likewise.

(cherry picked from commit 52b7b86f8c72eb19e637f1e72ffd10f39b8cb829)
gcc/testsuite/gcc.dg/vect/pr103116-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr103116-2.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc
This page took 0.058974 seconds and 5 git commands to generate.