<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Maybe llvm::PredicatedScalarEvolution is the one you’re looking for.<div class="">IIRC, it was created for loop versioning, so it might insert some runtime checks.</div><div class=""><br class=""></div><div class="">-Min<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 6, 2021, at 12:44 AM, Bangtian Liu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><p class="">Hi,</p><p class="">I have the following code as an example:  <br class=""> int j=-1;  <br class="">for (int i = 0; i < 100; ++i) <br class="">{       <br class="">     if (c[i] > 0.) {      <br class="">              j++;      <br class="">              e[j] = d[i];   <br class=""> }  }</p><p class="">How can I use LLVM's existing SCEV module to infer that e[j] could be consecutive if consecutive iterations' conditions are true?</p><p class="">Bests,</p><p class="">Bangtian</p><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" data-smartmail="gmail_signature" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><i class=""><span style="color:rgb(153,153,153)" class=""><span style="font-family:georgia,serif" class=""><b class=""><font size="2" class="">Bangtian Liu   刘 邦天 </font></b></span></span></i></div><div class=""><i class=""><span style="color:rgb(153,153,153)" class=""><span style="font-family:georgia,serif" class=""><b class=""><font size="2" class="">CS PhD Candidate<br class=""></font></b></span></span></i></div><div class=""><div class=""><br class=""></div></div><div class=""><i class=""><span style="color:rgb(153,153,153)" class=""><span style="font-family:georgia,serif" class=""><b class=""><font size="2" class="">Department of Computer Science </font><br class=""></b></span><font size="2" class=""><font face="tahoma, sans-serif" class=""><b class=""><span style="font-family:georgia,serif" class="">University of Toronto<br class="">Pratt 265C, 6 King's College Road, Toronto, ON M5S 3G4, Canada</span></b></font></font></span></i></div></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>