<div dir="ltr">Hi Sanjoy,<div><br></div><div>Really interesting read. I am perplexed now, and am not even sure what is the meaning of undef anymore.<br><br>Example (unrelated to your blog post, but still weird):</div><div>%x = sext i1 undef to i2</div><div><br></div><div>I understand that I can replace it by either of:</div><div>%x = i2 0</div><div>%x = i2 -1</div><div><br></div><div>But can I replace it by:</div><div>%x = i2 undef</div><div><br></div><div>I would have said no, at first sight, because -2 and 1 should not be possible values.</div><div>But if I look at each bit, independently, each one can be either 0 or 1. Then, if we</div><div>forget their "entanglement" (like we do shamelessly with xor %x, %x), and then</div><div>concatenate them back together, we get the i2 undef...</div><div><br></div><div>So I have no clue what is the actual semantic of undef.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 19, 2016 at 8:38 PM, 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">Hi Alexandre,<br>
<span class=""><br>
On Wed, Oct 19, 2016 at 11:19 AM, Alexandre Isoard<br>
<<a href="mailto:alexandre.isoard@gmail.com">alexandre.isoard@gmail.com</a>> wrote:<br>
> I am probably missing something important, but what I mean is that you can<br>
> always convert:<br>
><br>
> %y = xor %x, %x<br>
> to<br>
> %y = 0<br>
><br>
> Regardless of if %x is/might be an undef. That is, consider that reading %x<br>
> any number of times always give the value of its definition (as SSA<br>
> suggest). Therefore, disregarding the special semantic of undef (which is<br>
> always safe in this direction).<br>
><br>
> Is there an example of transformation which is forbidden by the fact that a<br>
> variable might be undef?<br>
<br>
</span>There are some examples earlier in this thread, but this is one:<br>
<a href="http://www.playingwithpointers.com/problem-with-undef.html" rel="noreferrer" target="_blank">http://www.<wbr>playingwithpointers.com/<wbr>problem-with-undef.html</a><br>
<br>
(Writing the blog post is already paying off :) )<br>
<span class="HOEnZb"><font color="#888888"><br>
-- Sanjoy<br>
</font></span></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>