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

Anadi Mishra reachanadi at gmail.com
Tue Apr 16 19:55:34 PDT 2013


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.



More information about the llvm-dev mailing list