<div dir="ltr">The files of this strange pass are described here <a href="http://reviews.legup.org/rLEGUP54ca7c2bb15d84116baf47bce67256d3803720d9">http://reviews.legup.org/rLEGUP54ca7c2bb15d84116baf47bce67256d3803720d9</a> . I wonderwhy the most uptodate -indvars pass can't do the same.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-09 14:18 GMT+02:00 Anastasiya Ruzhanskaya <span dir="ltr"><<a href="mailto:anastasiya.ruzhanskaya@frtk.ru" target="_blank">anastasiya.ruzhanskaya@frtk.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hello,<br></div>I have this piece of code:<br>int main() {<br> int m = 0;<br>// int i, j, k;<br>// int N = f()%10;<br> for (int l = 0; l < 1000; l+=4)<br> printf("%d", l);<br><br></div>I am sure, that llvm is capable to convert this into canonical induction variable, but even with O3<br>define i32 @main() #0 {<br> br label %2<br><br>; <label>:1 <wbr> ; preds = %2<br> ret i32 0<br><br>; <label>:2 <wbr> ; preds = %0, %2<br> %l.01 = phi i32 [ 0, %0 ], [ %4, %2 ]<br> %3 = tail call i32 (i8*, ...) @printf(i8* nonnull getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %l.01)<br> %4 = add nuw nsw i32 %l.01, 4<br> %5 = icmp slt i32 %4, 1000<br> br i1 %5, label %2, label %1<br>}<br><br></div>I have this assembler.<br></div>I know there is indvars2 pass ( it is under llvm license but used only in LegUp project - as I understood, surfing the Internet), which is good in changing induction variables.<br><br></div>How can I achieve that this cycle will have a canonical indvar?<br></div></div>
</blockquote></div><br></div>