<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
Hi, Jatin, <br>
<br>
Thanks for the response - that is helpful! <br>
<br>
Indeed the ScalarEvolution class contains a function <font face="Courier New">getLoopDisposition</font> that returns
<br>
the disposition {variant, invariant, computable} for a given SCEV expression, and a given loop.<br>
Considering that it takes the target loop as an argument it seems like the SCEV expressions
<br>
should be extracted at the scope of a particular loop using<font face="Courier New"> getSCEVAtScope(Loop *.<br>
<font face="Tahoma">Thoughts?</font><br>
<font face="Tahoma"><br>
Thanks,<br>
Hashim </font></font> <br>
<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF582795" style="direction: ltr;"><font face="Tahoma" color="#000000" size="2"><b>From:</b> soft.devl81@gmail.com [soft.devl81@gmail.com] on behalf of Jatin Bhateja [jatin.bhateja@gmail.com]<br>
<b>Sent:</b> Thursday, November 30, 2017 11:44 PM<br>
<b>To:</b> Sharif, Hashim<br>
<b>Cc:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] Using Scalar Evolution to Identify Expressions Evolving in terms of Loop induction variables<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div style="font-size:12.8px">Hi Hashim,</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Scalar evolution determines evolution of scalar in terms of expression chain driving it.</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Try dumping the detailed log using opt -analyze -scalar-evolution <.ll> -S , and look for LoopDispositions</div>
<div style="font-size:12.8px">corresponding to different expression which shows variance characteristics of a particular expression w.r.t</div>
<div style="font-size:12.8px">loop i.e. [computable/variant/invariant]<wbr>.</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Thanks</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 1, 2017 at 10:20 AM, Sharif, Hashim via llvm-dev
<span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt"><br>
Hi, <br>
<br>
I am using Scalar Evolution to extract access expressions (for load and store instructions) in terms of the loop induction variables.
<br>
I observe that the Scalar Evolution analysis is returning more expressions than I expect - including ones that are not defined
<br>
in terms of the loop induction variable. For instance in the following code: <br>
<br>
<br>
for(unsigned long int bid = 0; bid < no_of_queries; bid++){<br>
                                                           <wbr>                    
<br>
<div dir="ltr">    unsigned long int currNode = no_of_nodes / 2;<br>
    // process levels of the tree                          <wbr>                              <wbr>                              <wbr>   
<br>
    for(int i = 0; i < logN; i++){<br>
<br>
      if((knodes[currNode].key) > keys[bid]){<br>
        currNode = knodes[currNode].left_id;<br>
      }<br>
      else if ((knodes[currNode].key) < keys[bid]){<br>
        currNode = knodes[currNode].right_id;<br>
      }<br>
      else{<br>
         break;<br>
      }<br>
    }</div>
<div dir="ltr">}</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">I expect to extract a SCEV expression for the variable *keys*, however, using ScalarEvolution I also get an expression
<br>
</div>
<div dir="ltr">(using SE->getSCEV) for *knodes*. Since *knodes* does not evolve in terms of the loop induction variable I wasn't expecting to receive a SCEV
<br>
</div>
<div dir="ltr">expression for it. Can anyone please point out how SCEV expressions evolving in terms of the loop induction variable
<br>
</div>
<div dir="ltr">can be distinguished from expressions that are not. <br>
</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">-Hashim</div>
<div dir="ltr">University of Illinois at Urbana-Champaign</div>
<div dir="ltr"><br>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>