<div dir="ltr"><div>Do anyone know how to get LLVM's vectorizer to work on this code?<br>```<br>struct pair {<br>  int x[4], y[4];<br>};<br><br>void foo(int n, struct pair *a, int *restrict rx, int *restrict ry) {<br>  int x = 0, y = 0;<br>  for (int i = 0; i < n; i++) {<br>    x += (a+(i/4))->x[i%4];<br>    y += (a+(i/4))->y[i%4];<br>  }<br>  *rx = x;<br>  *ry = y;<br>}<br>```<br></div>I have a pass that converts structures such as {int, int} into {int x 4, int x 4}, but the transformation is profitable if it can work with the vectorizer.<br></div>