<div dir="ltr">I don't see how it changes the meaning of the program whether the compiler notices that two variables will always be 10 and 9 and does a compile time evaluation of 10 + 9 = 19, or generates an add instruction that turns out to  calculate the same result at runtime?<div><br></div><div>If you outline a function as you suggest, and then as a result don't know the return value, it just means you generate actual instructions to use that result as the programmer directed, rather than compile time propagating a constant 19 to whatever follows.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 2, 2015 at 10:06 AM, Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> I don't know how things work at the moment, but it seems to me that you can<br>
> do lots of sensible things, and avoid lots of silly things, if you keep<br>
> track of four possible values for each bit:<br>
><br>
> - undef (the default)<br>
> - poison<br>
> - known to be 0<br>
> - known to be 1<br>
<br>
</span>I'm not clear what you mean by "known to be X", but assuming you mean<br>
"known" in the same sense of computeKnownBits, then I don't think such<br>
a distinction will lead to intuitive semantics.  If the semantics of a<br>
program depended on what the compiler can prove about the program,<br>
then the meaning of a program will change based on how smart the<br>
compiler is (i.e. does the /compiler/ know that `add i32 10, 9` is<br>
`i32 19`?).  As a concrete example, outlining a function to a separate<br>
module will no longer be a meaning preserving transform because then a<br>
bit could go from "known to be 0" to "nothing is known".<br>
<br>
Sorry for the tangent, in case you meant something completely<br>
different by "known". :)<br>
<div class="HOEnZb"><div class="h5"><br>
-- Sanjoy<br>
<br>
--<br>
This message has been scanned for viruses and<br>
dangerous content by MailScanner, and is<br>
believed to be clean.<br>
<br>
</div></div></blockquote></div><br></div>