[PATCH] D42879: InstCombine: 1./x >= 0. -> x >= 0.

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 16:26:45 PST 2018


scanon added a comment.

In https://reviews.llvm.org/D42879#999833, @MatzeB wrote:

> In https://reviews.llvm.org/D42879#999811, @scanon wrote:
>
> > Underflow or overflow doesn't change sign, so 0 < C < inf && X >= 0 --> C/X >= 0.
>
>
> It doesn't change the sign. However we have to differentiate between three cases here: negative, null (or minus null), and positive.
>
> Underflow can change a value from positive or negative to null.
>  My understanding is that in case of underflow of large positive X the expression `C/X <= 0` may be true while `X <= 0` is not.


Ah, I see what you're trying to do.

In that case, you still have trouble because even 1/x can produce zero if someone is running with flush-to-zero enabled.


Repository:
  rL LLVM

https://reviews.llvm.org/D42879





More information about the llvm-commits mailing list