<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 24, 2016 at 5:57 PM, Michael Zolotukhin <span dir="ltr"><<a href="mailto:mzolotukhin@apple.com" target="_blank">mzolotukhin@apple.com</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"><div style="word-wrap:break-word"><br><div><div><div class="h5"><blockquote type="cite"><div>On May 24, 2016, at 5:47 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>> wrote:</div><div><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"><div class="gmail_extra"><div class="gmail_quote"><div>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></div></div></div></div></div></blockquote></div></div>It happens when SCEV analyzes an instruction like</div><span class=""><div>%offset = getelementptr inbounds float, float* null, i32 3</div></span></div></blockquote><div><br></div><div>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><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 class=""></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 class="">UnrolledInstAnalyzer</span><span class="">::</span><span class="">simplifyInstWithSCEV</span><span class=""> instead of trying to recover later?<br><br></span></div><div><span class="">-Eli<br></span> </div></div></div></div>