Another fix for single-element permutes (PR 84265)
commitf6022d0b2e0ae0e9cf5575a017164cb8e80c4cbb
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Feb 2018 15:17:20 +0000 (8 15:17 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Feb 2018 15:17:20 +0000 (8 15:17 +0000)
tree7d1c4f72e10b0597eae8549d8a317239cd7adf16
parenta5c5f57ec3a35fd7b9f71d1d549ca3e7cac2166c
Another fix for single-element permutes (PR 84265)

PR83753 was about a case in which we ended up trying to "vectorise"
a group of loads ore stores using single-element vectors.  The problem
was that we were classifying the load or store as VMAT_CONTIGUOUS_PERMUTE
rather than VMAT_CONTIGUOUS, even though it doesn't make sense to permute
a single-element vector.

In that PR it was enough to change get_group_load_store_type,
because vectorisation ended up being unprofitable and so we didn't
take things further.  But when vectorisation is profitable, the same
fix is needed in vectorizable_load and vectorizable_store.

2018-02-08  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/84265
* tree-vect-stmts.c (vectorizable_store): Don't treat
VMAT_CONTIGUOUS accesses as grouped.
(vectorizable_load): Likewise.

gcc/testsuite/
PR tree-optimization/84265
* gcc.dg/vect/pr84265.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257492 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr84265.c [new file with mode: 0644]
gcc/tree-vect-stmts.c