https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89908

            Bug ID: 89908
           Summary: Unnecessary rejection of dependence for outer loop
                    vectorisation
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

This loop:

void __attribute__ ((noipa))
f (int a[][N], int b[restrict])
{
  for (int i = N - 1; i-- > 0; )
    for (int j = 0; j < N - 1; ++j)
      a[j + 1][i] = a[j][i + 1] + b[i];
}

should be vectorisable using outer loop vectorisation, since the
dependence between the lhs and rhs is in the same nonzero direction
for both loops.

See https://gcc.gnu.org/ml/gcc-patches/2019-03/msg01224.html for
some discussion about how the dependence checks could be handled.

Reply via email to