<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 8, 2014 at 10:59 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">> If a poison value enters select, is the entire select poisoned?<br>
</span>Going with the obvious:<br>
<br>
 * if the condition is poison then the select is poison.<br>
 * otherwise the poison'ness of the select is the poison'ness of the<br>
input value that was dynamically selected.<br>
<span class=""><br>
> If not, that means select can _never_ be decomposed into arithmetic because<br>
> arithmetic propagates poison.<br>
<br>
</span>It can be, if the condition is a poison-propagating function of the<br>
two other inputs; which are the case where I think you'd want to<br>
arithmetize a select anyway.  Are there cases of selects which can be<br>
turned into arithmetic that have a condition that isn't poison when<br>
one or two of the inputs to the select are?<br></blockquote><div><br></div><div><div>If we are going by your definition of poison for select, then consider the following IR:<br></div></div><div>%sel = select i1 %c, i1 %x, i1 0<br></div><div><div><br></div><div><div>If %c is not poison and %x is poison, %sel *was* well-defined if %c is dynamically false.</div></div><div><br></div><div>Today, InstCombine will turn that into:</div><div>%sel = and i1 %c, %x</div><div><br></div></div><div>However, %sel will always be poison.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
-- Sanjoy<br>
</font></span></blockquote></div><br></div></div>