SLP vectorization of reductions is not implemented.
The following example demonstrate the opporunity for such vectorization:

==== cut here ======
struct mystr
{
  int f1;
  int f2;
};

struct mystr a[16];
struct mystr b[16];
int res1, res2;


void
foo (void)
{
  int i;
  int sum1;
  int sum2;

  for (i = 0; i < 16; i++)
  {
    sum1 += a[i].f1 + b[i].f1;
    sum2 += a[i].f2 + b[i].f2;
  }

  res1 = sum1;
  res2 = sum2;
}
==== cut here ======


-- 
           Summary: SLP loop vectorization missing support for reductions
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: victork at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37027

Reply via email to