[LLVMdev] RFC: Proposal for Poison Semantics

David Majnemer david.majnemer at gmail.com
Tue Jan 27 19:30:56 PST 2015


On Tue, Jan 27, 2015 at 7:22 PM, Chandler Carruth <chandlerc at google.com>
wrote:

>
> On Tue, Jan 27, 2015 at 6:50 PM, David Majnemer <david.majnemer at gmail.com>
> wrote:
>
>> Examples of this rule which do not result in poison:
>> ```
>>   %or  = or  i32 %always_poison, 2
>>   %and = and i32 %always_poison, 2
>>   %mul = mul i32 %always_poison, 0
>> ```
>>
>> In fact, it would be reasonable to optimize `%or` to `2` and `%and` to
>> `0`.  In this respect, poison is not different from `undef`.
>>
>
> The last time we discussed this, we were considering poison a property of
> an individual bit much like undef is a property of an indivdual bit. Are
> you no longer proposing those semantics? That is, while %or's second bit is
> clearly not poison, is the first bit (or LSB) poison?
>

Sorry this wasn't clear.  My intent was to say that bit 1 was set but that
the other bits were poison.  With this in mind, it is legal to throw the
poison away if you don't want to keep the or instruction if you replace it
with a value which has bit 1 set (these semantics are just like undef).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150127/0bf95da7/attachment.html>


More information about the llvm-dev mailing list