]> git.ipfire.org Git - thirdparty/gcc.git/commit
Don't use permutes for single-element accesses (PR83753)
authorRichard Sandiford <richard.sandiford@linaro.org>
Wed, 10 Jan 2018 13:07:54 +0000 (13:07 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 10 Jan 2018 13:07:54 +0000 (13:07 +0000)
commit6737facbb3c53a1f0158b05e4116c161ed9bc319
tree62ede51cd79130de6eb2ad0e1b0127c441143c2b
parente10e60cb6e6837eb0335fa1affa8aef71b21ecbf
Don't use permutes for single-element accesses (PR83753)

After cunrolling the inner loop, the remaining loop in the testcase
has a single 32-bit access and a group of 64-bit accesses.  We first
try to vectorise at 128 bits (VF 4), but decide not to for cost reasons.
We then try with 64 bits (VF 2) instead.  This means that the group
of 64-bit accesses uses a single-element vector, which is deliberately
supported as of r251538.  We then try to create "permutes" for these
single-element vectors and fall foul of:

      for (i = 0; i < 6; i++)
sel[i] += exact_div (nelt, 2);

in vect_grouped_store_supported, since nelt==1.

Maybe we shouldn't even be trying to vectorise statements in the
single-element case, and instead just copy the scalar statement
for each member of the group.  But until then, this patch treats
non-strided grouped accesses as VMAT_CONTIGUOUS if no permutation
is necessary.

2018-01-10  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/83753
* tree-vect-stmts.c (get_group_load_store_type): Use VMAT_CONTIGUOUS
for non-strided grouped accesses if the number of elements is 1.

gcc/testsuite/
PR tree-optimization/83753
* gcc.dg/torture/pr83753.c: New test.

From-SVN: r256427
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr83753.c [new file with mode: 0644]
gcc/tree-vect-stmts.c