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

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 10:06:32 PST 2018


MatzeB added a comment.

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

> In https://reviews.llvm.org/D42879#999160, @spatel wrote:
>
> > Do we need to restrict this to 1.0 / X ? If we only care about the sign of the fdiv result and we're ruling out INF, then any constant 'C / X' should be ok? Can also handle 'X / C'?
>
>
> It gets slightly harder with C/X because for large C we can underflow to zero if X is big enough. I wasn't sure how to compute the limit so went with 1.0 for now.


Of course it's small C where we could underflow, not large C.


Repository:
  rL LLVM

https://reviews.llvm.org/D42879





More information about the llvm-commits mailing list