<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 24, 2016, at 6:07 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" class="">eli.friedman@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, May 24, 2016 at 5:57 PM, Michael Zolotukhin <span dir="ltr" class=""><<a href="mailto:mzolotukhin@apple.com" target="_blank" class="">mzolotukhin@apple.com</a>></span> wrote:<br class=""><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" class=""><br class=""><div class=""><div class=""><div class="h5"><blockquote type="cite" class=""><div class="">On May 24, 2016, at 5:47 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" target="_blank" class="">eli.friedman@gmail.com</a>> wrote:</div><div class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">How are you getting into a situation where "V.getType() != SimplifiedValues.lookup(V).getType()"?  It seems like there's an underlying problem which is getting ignored here.<br class=""></div></div></div></div></div></blockquote></div></div>It happens when SCEV analyzes an instruction like</div><span class=""><div class="">%offset = getelementptr inbounds float, float* null, i32 3</div></span></div></blockquote><div class=""><br class=""></div><div class="">Ah, I see, <span class="">SCEVConstant::getValue returns a ConstantInt.  That's probably reasonable from the perspective of SCEV, since it fundamentally always works with integers.<br class=""></span></div></div></div></div></div></blockquote>Yeah, that’s what I thought too.<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><span class=""><br class=""></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 class=""></span><div class=""><div class="">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 class=""><br class=""></div><div class="">Maybe you could construct an inttoptr constant expression in <span class="">UnrolledInstAnalyzer</span><span class="">::</span><span class="">simplifyInstWithSCEV</span><span class=""> instead of trying to recover later?<br class=""></span></div></div></div></div></div></blockquote>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><div><br class=""></div><div>Michael<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><span class=""><br class=""></span></div><div class=""><span class="">-Eli<br class=""></span> </div></div></div></div>
</div></blockquote></div><br class=""></body></html>