<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 24, 2016 at 6:24 PM, Michael Zolotukhin <span dir="ltr"><<a href="mailto:mzolotukhin@apple.com" target="_blank">mzolotukhin@apple.com</a>></span> wrote:<span class=""></span><br><span class=""></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><span class=""><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span><br></span>  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span></span><div><div>When asked for a value at some iteration, SCEV considers ‘null' as 0 and returns, for instance, ‘i32 24’. I’m not sure if it’s incorrect, that’s why I fixed it in this spot.</div></div></blockquote><div><br></div><div>Maybe you could construct an inttoptr constant expression in <span>UnrolledInstAnalyzer</span><span>::</span><span>simplifyInstWithSCEV</span><span> instead of trying to recover later?<br></span></div></div></div></div></div></blockquote></span>That would require adding a special case handling to simplifyInstWithSCEV, which I prefer to avoid. Currently we don’t look at what type of instruction we’re analyzing at all - we completely rely on SCEV there.<div><br></div></div></blockquote><div><br></div><div>Okay.  It would be nice to document somewhere in the source code, since it's a hazard for anyone updating the code.  Also, there's a missing check for the type of the constants in <span class=""></span><span class="">visitCmpInst</span><span class="">.</span><br><span class=""></span></div></div><span class=""><br></span></div><div class="gmail_extra"><span class="">-Eli<br></span></div></div>