Hi,<div><br></div><div>What does your LLVM IR look like. Are you sure the loop hasnt been optimized away?</div><div><br></div><div>Arushi<br><br><div class="gmail_quote">On Sat, May 21, 2011 at 5:52 PM, Malveeka Tewari <span dir="ltr"><<a href="mailto:mtewari@eng.ucsd.edu">mtewari@eng.ucsd.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi<div><br></div><div>I have the followed code for which I am writing a loop pass.</div><div><div><br></div><div>int main() {</div>

<div>  int i = 0;</div><div>  for (i=0; i<20; i++) {</div><div>    printf ("hello world %d\n", i); </div>
<div>  }</div><div>  return 0;</div><div>}</div><div><br></div></div><div>In the function runOnLoop, I have the following instruction</div><div>PHINode *indv = NULL;</div><div>indv = L->getCanonicalInductionVariable();</div>


<div><br></div><div>However, when I check indv is always set to NULL.</div><div>Since the code has a canonical induction variable, I was expecting the endv to start pointing to the induction var phi node.</div><div><br></div>


<div>Please let me what I'm missing here</div><div><br></div><div>Thanks</div><div>Malveeka</div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>