]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Use start value in vect_load_perm_consecutive_p [PR122797].
authorRobin Dapp <rdapp@ventanamicro.com>
Sat, 22 Nov 2025 19:53:25 +0000 (20:53 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Mon, 24 Nov 2025 19:43:10 +0000 (20:43 +0100)
commit54e9c0be90fa87767d57ff682e044959feb754f2
tree7d6207275df2d70532fce9a3882908ee82eb15aa
parent283eb27d5f674b6fb11d8640495993e2ec693608
vect: Use start value in vect_load_perm_consecutive_p [PR122797].

vect_load_perm_consecutive_p is used in a spot where we want to check
that a permutation is consecutive and starting with 0.  Originally I
wanted to add this way of checking to the function but what I ended
up with is checking whether the given permutation is consecutive
starting from a certain index.  Thus, we will return true for
e.g. {1, 2, 3} which doesn't make sense in the context of the PR.
This patch corrects it.

PR tree-optimization/122797

gcc/ChangeLog:

* tree-vect-slp.cc (vect_load_perm_consecutive_p): Check
permutation start at element 0 with value instead of starting
at a given element.
(vect_optimize_slp_pass::remove_redundant_permutations):
Use start value of 0.
* tree-vectorizer.h (vect_load_perm_consecutive_p): Set default
value to to UINT_MAX.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/pr122797.c: New test.
gcc/testsuite/gcc.dg/vect/pr122797.c [new file with mode: 0644]
gcc/tree-vect-slp.cc
gcc/tree-vectorizer.h