[autovect, patch] Relax loop-aware SLP group size constraints

Ira Rosen IRAR@il.ibm.com
Tue Jul 31 11:08:00 GMT 2007


This patch removes constraints from SLP group size (until now only groups
of size multiple of vector size or vice versa were supported). The
adjustment to the vector size is done using conceptual unrolling by lcm
(group size, vector size) / group size.

For example, the loop (with group size 6 and vector size 4)

for (i=0; i < n; i++)
{
   a[6*i + 0] = 0;
   a[6*i + 1] = 1;
   a[6*i + 2] = 2;
   a[6*i + 3] = 3;
   a[6*i + 4] = 4;
   a[6*i + 5] = 5;
}

will now be SLPed with conceptual unrolling by 2 (lcm (6,4) / 6 = 12/6 =
2):

for (i=0; i < n/2; i++)
{
   a[6*i + 0: 6*i +3] = {0,1,2,3};
   a[6*i + 4: 6*i +7] = {4,5,0,1};
   a[6*i + 8: 6*i +11] = {2,3,4,5};
}


Bootstrapped and tested on ppc-linux. Committed to autovect-branch.

Ira

ChangeLog entry:

        * tree-vect-analyze.c (vect_analyze_operations): Set vectorization
        factor according to SLP unrolling factors.
        (vect_analyze_data_ref_access): Remove SLP group size constraints.
        (vect_analyze_slp_instance): Calculate SLP instance unrolling
factor.
        * tree-vect-transform.c (vect_get_constant_vectors): Fix number of
        copies calculation to handle general group sizes.

(See attached file: group_size.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: group_size.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070731/3c41c41b/attachment.txt>


More information about the Gcc-patches mailing list