If we consider the following simple test-case int a[100]; void foo() { a[0] = a[1] = a[2] = a[3] = 0; } SLP vectorization of basic block takes place: gcc -S -O3 -m32 t.c -ftree-vectorizer-verbose=1 t.c:4: note: Vectorized basic-block but if we add at least one more assignment it won't be vectorized: a[0] = a[1] = a[2] = a[3] = a[4] = 0; t11.c:4: note: Build SLP failed: unrolling required in basic block SLP It is clear that gcc can do partial BB vectorization, i.e. vectorize the first 4 assignments only.
Should be handled via the code we already have for splitting groups into vector-sized pieces.
which would kind-of automagically work if we just delay that "unrolling" check (that's of course somewhat expensive). There are more group splitting improvement possibilities.
Author: vekumar Date: Mon May 23 09:48:54 2016 New Revision: 236582 URL: https://gcc.gnu.org/viewcvs?rev=236582&root=gcc&view=rev Log: Fix PR58135. 2016-05-23 Venkataramanan Kumar <venkataramanan.kumar@amd.com> PR tree-optimization/58135 * tree-vect-slp.c: When group size is not multiple of vector size, allow splitting of store group at vector boundary. 2016-05-23 Venkataramanan Kumar <venkataramanan.kumar@amd.com> * gcc.dg/vect/bb-slp-19.c: Remove XFAIL. * gcc.dg/vect/pr58135.c: Add new. * gfortran.dg/pr46519-1.f: Adjust test case. Added: trunk/gcc/testsuite/gcc.dg/vect/pr58135.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/vect/bb-slp-19.c trunk/gcc/testsuite/gfortran.dg/pr46519-1.f trunk/gcc/tree-vect-slp.c
Fixed the PR. ref: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=236582 2016-05-23 Venkataramanan Kumar <venkataramanan.kumar@amd.com> PR tree-optimization/58135 * tree-vect-slp.c: When group size is not multiple of vector size, allow splitting of store group at vector boundary. 2016-05-23 Venkataramanan Kumar <venkataramanan.kumar@amd.com> * gcc.dg/vect/bb-slp-19.c: Remove XFAIL. * gcc.dg/vect/pr58135.c: Add new. * gfortran.dg/pr46519-1.f: Adjust test case