]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Support more VLA SLP permutations [PR116583]
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 7 Oct 2024 12:03:04 +0000 (13:03 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Mon, 7 Oct 2024 12:03:04 +0000 (13:03 +0100)
commit8157f3f2d211bfbf53fbf8dd209b47ce583f4142
treecabc4ec90862280ccb0cf4f877fce2145ca32d4e
parent2abd04d01bc4e18158c785e75c91576b836f3ba6
vect: Support more VLA SLP permutations [PR116583]

This is the main patch for PR116583.  Previously, we only
supported VLA SLP permutations for which the output and inputs
have the same number of lanes, and for which that number of
lanes divides the number of vector elements.

The patch extends this to handle:

(1) "packs" of a single 2N-vector input into an N-vector output
(2) "unpacks" of N-vector inputs into an XN-vector output

Hopefully the comments in the code explain the approach.

The contents of the:

  for (unsigned i = 0; i < ncopies; ++i)

loop do not change; the patch simply adds an outer loop around it.

The patch removes the XFAIL in slp-13.c and also improves
the SVE vect.exp results with vect-force-slp=1.  I haven't
added new tests specifically for this, since presumably the
existing ones will cover it once the SLP switch is flipped.

gcc/
PR tree-optimization/116583
* tree-vect-slp.cc (vectorizable_slp_permutation_1): Handle
variable-length pack and unpack permutations.

gcc/testsuite/
PR tree-optimization/116583
* gcc.dg/vect/slp-13.c: Remove xfail for vect_variable_length.
* gcc.dg/vect/slp-13-big-array.c: Likewise.
gcc/testsuite/gcc.dg/vect/slp-13-big-array.c
gcc/testsuite/gcc.dg/vect/slp-13.c
gcc/tree-vect-slp.cc