[llvm-dev] how to simplify FP ops with an undef operand?
Nuno Lopes via llvm-dev
llvm-dev at lists.llvm.org
Thu Mar 1 14:31:07 PST 2018
>> On Thu, Mar 1, 2018 at 2:08 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>> We can do "add %x, undef" => "undef" because for any value of %x, we can
>> always find a value that when added to %x produces any value in the
>> domain of integers.
>>
>> This is not the case with floats since with some inputs, e.g., NaNs, we
>> are not able to produce some values in the domain (e.g., there's no value
>> of %x that makes "fadd NaN, %x" return 42.0).
>>
>> In summary, since there's no NaN constant in the IR
>
> Isn't "float 0x7FF8000000000000" a NaN constant?
Ok, my bad, you can use the binary value directly. There are several NaN
values, but I guess we could canonicalize on one of them.
Nuno
More information about the llvm-dev
mailing list