Hello,

I am working on gcc-4.9.4 and encountered different results of loop
vectorization on array arr0, arr1 and arr2.

Testcase -

int main()
  {
    int i;
    for (i=0; i<64; i++)
      {
        arr2[i]=(arr1[i]|arr0[i]);
      }
  }

Using -O2 -ftree-vectorize, Above loop is vectorized if arr0, arr1,
arr2 are global arrays whereas if they are local, loop is not getting
vectorized.

1. Is there any flag which will enable vectorization of loop which
will operate on local array as well?

2. Which part of code I need to tweak so that I would get
vectorization on loops operating on local arrays or at least know why
vectorization is not suggested for such loops?

Thanks and Regards
Shubham

Reply via email to