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

Cong Hou <congh at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |congh at google dot com

--- Comment #2 from Cong Hou <congh at google dot com> ---
I have made a patch on this issue. However, I don't think the example here is
proper. Say z1 == &(x[0][4]) (assume VF=4). Then after unrolling the loop for 4
times, there is still no data dependence that prevents vectorization.

I think a better example is like the one shown below:



__attribute__((noinline, noclone)) void
foo (float x[3][32], float y1, float y2, float y3, float *z1, float *z2, float
*z3)
{
  int i;
  for (i = 0; i < 16; i++)
    {
      z1[i] = -y1 * x[0][i*2];
      z2[i] = -y2 * x[1][i*2];
      z3[i] = -y3 * x[2][i*2];
    }
}


Here we have to make sure z1/z2/z3 does not alias with x across the whole range
being traversed. Then we could merge the alias checks between z1 and
&x[0][0:32]/&x[1][0:32]/&x[2][0:32] into one.

Reply via email to