[llvm-dev] RFC: Killing undef and spreading poison
Nuno Lopes via llvm-dev
llvm-dev at lists.llvm.org
Tue Oct 18 14:29:07 PDT 2016
> On 10/18/2016 3:12 PM, Sanjoy Das wrote:
>> But in the new proposal, in:
>>
>> %x = freeze(poison)
>> %y = xor %x, %x
>>
>> that is no longer allowed (%y _has_ to be 0) -- all uses of %x will see
>> some garbage, but fixed bit pattern.
>
> What about this:
> %x = phi poison, poison (I'm simplifying the syntax here)
> Can this be simplified to "%x = poison", i.e. can we rauw(%x, poison)?
Yes, that's ok.
> %x = load %uninitialized_var
> %y = load %uninitialized_var
> // are %x and %y equal (i.e. is "cmp eq %x, %y" == true)?
> // is freeze(%x) equal to freeze(%y)?
"icmp %x, %y" would be poison (so you can chose true or false if you wish).
There's no change here with respect to current poison semantics.
freeze(%x) is not necessarily the same as freeze(%y). Even %a and %b might
not be the same in "%a = freeze(%x), %b = freeze(%x)" (each freeze returns
an arbitrary, but fixed, value).
Nuno
More information about the llvm-dev
mailing list