It is beneficial to unroll reduction loop (and split the reduction target) to
reduce dependence height due to recurrence, but GCC does not perform such
optimization (-O3 -fno-tree-vectorize)


int a[1000];
int b[1000];
int foo(int n)
{

   int s = 0;
   int i = 0;
   for (i = 0; i < 1000 ; i++)
   {
       s += a[i] + b[2*i];
   }
   return s;
}


-- 
           Summary: Sum-reduction loop not recognized
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: xinliangli at gmail dot com


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

Reply via email to