<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 24, 2017 at 3:08 PM, John Regehr <span dir="ltr"><<a href="mailto:regehr@cs.utah.edu" target="_blank">regehr@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Also I should add that I strongly doubt that it will be acceptable to simply call ScalarEvolution's integer range analysis from LVI. The right answer is no doubt more nuanced and the actual experts in this stuff are here and hopefully they can chime in with opinions.</blockquote><div>It looks like in LazyValueInfoCache::solveBlockValuePHINode we only get the upper bound of the PHINode in the above example in getEdgeValue.</div><div>Thus it generates range like <span style="font-size:12.8px">constantrange<-</span><a href="tel:(214)%20748-3648" value="+12147483648" target="_blank" style="font-size:12.8px">2147483648</a><span style="font-size:12.8px">, 20>.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">In order to also get the lower bound, we need to prove the PN is is monotonically increasing. And such code had been implemented in SCEV. Maybe we could factor these code out and use them in both LVI and SCEV.</span></div><div><span style="font-size:12.8px"><br></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Also, I am hoping to get together with a few people who care about LVI at the October dev meeting, you should join if you are going to attend.</blockquote><div>Sure </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-HOEnZb"><font color="#888888"><br>
<br>
John</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<br>
On 07/24/2017 03:59 PM, John Regehr wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On 07/24/2017 03:43 PM, Hongbin Zheng wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    Also, the last time I looked, there seemed to be a fair amount of<br>
    room for improvement in LVI and ConstantRange.<br>
<br>
Could you point some out?<br>
</blockquote>
<br>
Check out the TODO items in binaryAnd and BinaryOr in ConstantRange.cpp.<br>
<br>
There are some missing cases in the switch in ConstantRange::binaryOp, such as xor and ashr.<br>
<br>
Argh this is embarrassing, I have some unfinished work sitting in Phabricator that could use a helper if you have time to take a look:<br>
<br>
<a href="https://reviews.llvm.org/D19859" rel="noreferrer" target="_blank">https://reviews.llvm.org/D1985<wbr>9</a><br>
<a href="https://reviews.llvm.org/D20669" rel="noreferrer" target="_blank">https://reviews.llvm.org/D2066<wbr>9</a><br>
<a href="https://reviews.llvm.org/D19867" rel="noreferrer" target="_blank">https://reviews.llvm.org/D1986<wbr>7</a><br>
<a href="https://reviews.llvm.org/D19559" rel="noreferrer" target="_blank">https://reviews.llvm.org/D1955<wbr>9</a><br>
<br>
John<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div></div>