<div dir="ltr">Given a test case:<div><br></div><div>#define N 10<br>struct foo {<br>  float a[N][N];<br>  float b[N];<br>};<br><br>void compute(struct foo *p)<br>{<br>  for (int i = 0; i < N; i++) {<br>    for (int j = 0; j < N; j++) {<br>      p->a[i][j] += 0.1f * p->b[i];<br>    }<br>  }<br>}<br></div><div><br></div><div>LLVM isn't able to vectorize this code. I'm not sure what the issue is here as it seems to vectorize this code:</div><div><br></div><div>#define N 10<br>struct foo {<br>  float a[N];<br>  float b[N];<br>};<br><br>void compute(struct foo *p)<br>{<br>  for (int i = 0; i < N; i++) {<br>      p->a[i] += 0.1f * p->b[i];<br>  }<br>}<br></div><div><br></div><div>Is this a known issue?</div><div><br></div><div>-Ryan</div></div>