<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 8, 2014 at 3:24 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">David Majnemer wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It's a correctness issue.<br>
<br>
In general one cannot know whether or not a divide instruction is safe<br>
to execute because isKnownNonZero returns true for poison.<br>
<br>
It is possible for the right hand side of the divide to always be poison<br>
in a valid program so long as the divide cannot ever be executed.<br>
</blockquote>
<br></span>
Actually wait, how does that happen in practice? You need to have already had an integer overflow or something to trigger poison, right?<br></blockquote></div><br>I think poison may be misleading... I think this is true for undef as well unless you actually *transform* the divisor into some non-zero value so that undef is collapsed to 1 for example. Otherwise something else can collapse the undef to 0 invalidating the query. So divide is just not safe to speculate with an undef (or poison?) divisor, even though such a divisor satisfies "non-zero". Speculation of divide requires transforming the divisor.</div></div>