<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">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>