<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 18, 2016 at 9:12 PM, Sanjoy Das via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Krzysztof,<br>
<br>
freeze(poison) is different from undef today, in the sense that it is an instruction that produces some random, but fixed bit pattern.<br>
<br>
E.g. today in<br>
<br>
  %x = undef<br>
  %y = xor %x, %x<br>
<br>
we can fold %y to undef since each use of %x can independently see some arbitrary (up to the compiler / environment) bit pattern.<br></blockquote><div>We can also fold it to %y = 0 if we want, isn't it? </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But in the new proposal, in:<br>
<br>
  %x = freeze(poison)<br>
  %y = xor %x, %x<br>
<br>
that is no longer allowed (%y _has_ to be 0) -- all uses of %x will see some garbage, but fixed bit pattern.<br></blockquote><div>What is the real motivation behind introducing a new kind of undef?</div><div><br></div><div>I remember having read that undef does not obey all the rules of SSA. That is, a variable %x set to undef is in fact not initialized at it's definition but at each of it's use instead. Which is an argument I never quite understood, because the nature of undef is that we can safely restrict ourself to a classic aproach where %x has the same value at each use (as the compiler is free to assign any value to any undef it encounter). This does not exploit all of the freedom offered by undef, but is always valid, isn't it?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- Sanjoy<span class="im HOEnZb"><br>
<br>
<br>
Krzysztof Parzyszek via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/18/2016 2:25 PM, Nuno Lopes via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Right, a load touching a single uninitialized bit results in poison.<br>
The trick is that on the first bitfield write, all the remaining<br>
untouched fields become initialized (with an arbitrary value, though).<br>
Essentially we are making the adjacent bitfields undef.<br>
</blockquote>
<br>
So "undef" still exists, except now it's obtainable via "freeze(poison)"?<br>
<br>
-Krzysztof<br>
<br>
</blockquote></span><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div>
</div></div>