]> git.ipfire.org Git - thirdparty/gcc.git/commit
Allow inner-loop reductions with variable-length vectors
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 9 Aug 2018 16:03:25 +0000 (16:03 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 9 Aug 2018 16:03:25 +0000 (16:03 +0000)
commitb8d5e148f669d56ccfd294dc396daba607237cdb
tree30024b7111392033a7f7ca3969997417773fc6fd
parent56b61d7fc4f38c1a3fd51bf3315b0338513a2d2d
Allow inner-loop reductions with variable-length vectors

While working on PR 86871, I noticed we were being overly restrictive
when handling variable-length vectors.  For:

  for (i : ...)
    {
      res = ...;
      for (j : ...)
        res op= ...;
      a[i] = res;
    }

we don't need a reduction operation (although we do for double
reductions like:

  res = ...;
  for (i : ...)
    for (j : ...)
      res op= ...;
  a[i] = res;

which must still be rejected).

2018-08-08  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-loop.c (vectorizable_reduction): Allow inner-loop
reductions for variable-length vectors.

gcc/testsuite/
* gcc.target/aarch64/sve/reduc_8.c: New test.

From-SVN: r263451
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/reduc_8.c [new file with mode: 0644]
gcc/tree-vect-loop.c