[llvm-dev] how to simplify FP ops with an undef operand?

Stephen Canon via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 6 13:27:11 PST 2018



> On Mar 6, 2018, at 4:25 PM, Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> 
> 
>> On Mar 6, 2018, at 7:23 AM, Sanjay Patel via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>> 
>> I need to review the last thread about undef/poison (or someone who knows current status of that can reply), but this would seem to come down to whether undef applies to the entire value or the individual bits?
>> Ie, in your example the sign bit will never be set unless all of the exponent bits are also set. Each bit individually is unknown, but taken together we know that some sequences are impossible.
> 
> The “on the ground” reason we made undef be a bit-level concept for integers was specific problems with C bitfields: when initializing a mem2reg’d bitfield, you end up doing or’s into undef values, and those bits have to be defined.  
> 
> I’m not aware of a similar concept that makes sense for fp values.  We could choose to do fine grain tracking (e.g. so ldexp and friends would work to set the exponent??) but I don’t see any practical reason for doing so.

I agree. Tracking the signbit might be interesting sometimes, but it’s a second-order effect.

– Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180306/19151739/attachment.html>


More information about the llvm-dev mailing list