<div dir="ltr"><p dir="ltr">Hi,</p>
<p dir="ltr">My understanding of induction variable is that it drives the loop with fixed increment and by comparing it based on a condition (Hope I understood it right). I want to extract and print this variable and what it is compared to.</p>
<p dir="ltr">I have been trying to understand the ScalarEvolution and SCEVexpander through llvm documentation are there any examples on how it is used, because I have not been able to understand its usage properly.</p>
<p dir="ltr">Thanks and Regards<br>
Archa</p>
<div class="gmail_quote">On 01-Jul-2017 3:54 pm, "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <p>Hi, Archa,</p>
    <p>What do you want to do with the induction variable? For most uses
      cases, you can use the ScalarEvolution analysis (and, if
      necessary, the ScalarEvolutionExpander).</p>
    <p> -Hal<br>
    </p>
    <div class="m_5121249198770606667m_3779882622668283580moz-cite-prefix">On 07/01/2017 03:56 AM, Archa . via
      llvm-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hi, 
        <div><br>
        </div>
        <div>I was looking at trying to get loop induction variable at
          IR level. LLVM documentation mentioned indvars pass and
          getCanonicalInductionVariable(<wbr>) to get them, I tried running
          the indvars pass and then a custom pass which iterates through
          loops and uses the function to obtain variable for a simple
          loop program. But the API returns null. I also read in similar
          posts that the indvars pass is not available in the current
          version but documentation still mentions them.</div>
        <div><br>
        </div>
        <div>Is there something I am missing in my method , or is there
          an alternative method to get the induction variable in the
          latest version.</div>
        <div><br>
        </div>
        <div>Thanks in advance</div>
        <div><br>
        </div>
        <div>Regards
          <div>
            <div class="m_5121249198770606667m_3779882622668283580gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div>
                          <div>Archa</div>
                        </div>
                        <br>
                        <div>
                          <div>
                            <div><br>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_5121249198770606667m_3779882622668283580mimeAttachmentHeader"></fieldset>
      <br>
      <pre>______________________________<wbr>_________________
LLVM Developers mailing list
<a class="m_5121249198770606667m_3779882622668283580moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="m_5121249198770606667m_3779882622668283580moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="m_5121249198770606667m_3779882622668283580moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </div>

</blockquote></div>
</div>