hi,<br><br><div class="gmail_quote">On Fri, May 7, 2010 at 8:59 AM, Trevor Harmon <span dir="ltr"><<a href="mailto:Trevor.W.Harmon@nasa.gov">Trevor.W.Harmon@nasa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
For me, getTripCount always returns null, even for trivial loops such<br>
as:<br>
<br>
void simple(int j) {<br>
     for (int i = 0; i < 10; i++) {<br>
         j++;<br>
     }<br>
}<br>
<br>
Looking through the mailing list archive, it appears that getTripCount<br>
requires certain optimization passes to run first, but it's not clear<br>
which ones. There doesn't seem to be any documentation on this. Does<br>
anybody know exactly which passes must run in order for getTripCount<br>
to work?<br></blockquote><div>As the comment said:<br>  /// The IndVarSimplify pass transforms loops to have a form that this<br>  /// function easily understands.<br><br>you could try -indvars.<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Thanks,<br>
<br>
Trevor<br>
<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>
</blockquote></div>best regards<br>ether<br>