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>