[LLVMdev] Loop vectorizer behaviour for 2D arrays and parallel annotation

Anadi Mishra
Wed, 17 Apr 2013 02:55:34 -0000

Hello,

I am trying to vectorize the following loop but the vectorizer says:
"Found a possible write-write reorder" and does not vectorize.

Why?



for (j=0; j < 8; j++)
  {
    jj = j << 3;
    m2[j][0] = diff[jj  ] + diff[jj+4];
    m2[j][1] = diff[jj+1] + diff[jj+5];
    m2[j][2] = diff[jj+2] + diff[jj+6];
    m2[j][3] = diff[jj+3] + diff[jj+7];
    m2[j][4] = diff[jj  ] - diff[jj+4];
    m2[j][5] = diff[jj+1] - diff[jj+5];
    m2[j][6] = diff[jj+2] - diff[jj+6];
    m2[j][7] = diff[jj+3] - diff[jj+7];
  }


Another question is regarding the isannotatedparallel() check. Is
there a way to make clang (or any other frontend) to generate parallel
annotated IR?


Best,
Anadi.