<div dir="ltr">Great, thanks a lot!<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-07-25 23:48 GMT+02:00 Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@google.com" target="_blank">sanjoy@google.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Anastasiya,<br>
<br>
If it fits you use case, you can consider walking the loop header and<br>
calling getSCEV() on all of the PHI nodes in the header.  This will<br>
give you a SCEV* which should be easier to analyze than manually<br>
inspecting PHI cycles.<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888">-- Sanjoy<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Tue, Jul 25, 2017 at 11:42 AM, Michael Kruse via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> 2017-07-25 19:32 GMT+02:00 Anastasiya Ruzhanskaya<br>
> <<a href="mailto:anastasiya.ruzhanskaya@frtk.ru">anastasiya.ruzhanskaya@frtk.<wbr>ru</a>>:<br>
>> I call this function and it returns only "i" in my example.  Are there any<br>
>> ways to return "j" also?<br>
><br>
> That would contradict it being the /canonical/ induction variable, wouldn't it?<br>
><br>
> If you look into the imlplementation of<br>
> getCanonicalInductionVariable(<wbr>), it just walks the IR instructions and<br>
> checks some conditions. You can have your own implementation that,<br>
> instead of returning the first matching PHI, return all matching PHIs.<br>
> SimplifyIndVar won't try to canonicalize, though.<br>
><br>
> Michael<br>
</div></div><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>