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

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 08:37:18 PST 2018


scanon added a comment.

In https://reviews.llvm.org/D42879#1000576, @spatel wrote:

> In https://reviews.llvm.org/D42879#999858, @scanon wrote:
>
> > In that case, you still have trouble because even 1/x can produce zero if someone is running with flush-to-zero enabled.
>
>
> IIUC, we also have out-of-tree targets with no option; they always operate with FTZ behavior.
>
> I think it's still possible to allow this kind of transform in instcombine with more fast-math-flags. Clang/gcc's -fassociative-math translates indirectly to 'reassoc' in IR FMF and says it may "reorder floating-point comparisons".


Correct. This falls in the pile of "things we could optimize if we modeled fenv".


Repository:
  rL LLVM

https://reviews.llvm.org/D42879





More information about the llvm-commits mailing list