<div dir="ltr">Good afternoon,<div><br></div><div>I'm working on modifying the Mips backend in order to add new functionalities. I've successfully implemented the intrinsics, but I want to recognize a pattern like this:</div><div><br></div><div>int seq[max];</div><div>int cnt = 0;</div><div><br></div><div>for (int i = 0; i < max; i++)</div><div>{</div><div><div>  Â for (int j = 0; i < 16; i++)</div><div>  Â {</div><div>  Â  Â  Â char hn = (seq[i] & (3<<(j*2)) >> (j*2);</div><div>  Â  Â  Â if (hn == 2)</div><div>  Â  Â  Â  Â  {</div><div>  Â  Â  Â  Â  Â  Â cnt++;</div><div>  Â  Â  Â  Â  }</div><div>  Â } </div></div><div>}</div><div><br></div><div><br></div><div>and transform it into something like:</div><div><br></div><div><div>int seq[max];</div><div>int cnt = 0;</div><div><br></div><div>for (int i = 0; i < max; i++)</div><div>{</div><div><div>  cnt += intrinsic(seq[i], 2); </div></div><div>}</div></div><div><br></div><div>Do you know what I can use to transform the loop? Or if exists something similar in LLVM? </div><div><br></div><div>Thanks,</div><div><br></div><div>Catello</div></div>