This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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)

Attachment: group_size.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]