[Bug tree-optimization/56764] vect_prune_runtime_alias_test_list not smart enough

congh at google dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 7 18:55:00 GMT 2013


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
  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.

More information about the Gcc-bugs mailing list