I am trying to use the indvars pass on a simple loop but it does not seem to have any effect<br>The sample code i am using is <br><br>#include <stdio.h><br>int test (int p);<br>int main(){<br> int a,b=3;<br> for(a=7;a*a<100;++a){<br>
if(b >3)<br> test(3);<br> b++; <br> }<br> <br>return 1;<br>}<br>int test(int p){<br> return p;<br>}<br clear="all"><br>According to documentation the loop should get converted to something like <br>
<pre>for (a = 0; a != 25; ++a)<br> but the generated IR does not reflect this.the loop still goes from 7 to 99. Neither is there a Phinode for a<br>I am using the following commands<br><br>llvm-gcc -emit-llvm -c hello.c<br>
opt -indvars hello.o >hello.bc<br>llvm-dis hello.bc<br><br>Is there something I am missing?<br><br>Thanks,<br></pre>-- <br>Kshitiz Garg<br>Graduate Student<br>Department of Computer Science & Engineering<br>IIT Kanpur<br>
<a href="http://home.iitk.ac.in/~kshitizg">http://home.iitk.ac.in/~kshitizg</a><br>