Simplify floating point comparisons
This patch implements some of the optimizations discussed in PR71026.
Simplify (C / x >= 0.0) into x >= 0.0 with -funsafe-math-optimizations
(since C / x can underflow to zero if x is huge, it's not safe otherwise).
If C is negative the comparison is reversed.
Simplify (x * C1) > C2 into x > (C2 / C1) with -funsafe-math-optimizations.
If C1 is negative the comparison is reversed.
gcc/
PR 71026/tree-optimization
* match.pd: Simplify floating point comparisons.
gcc/testsuite/
PR 71026/tree-optimization
* gcc.dg/div-cmp-1.c: New test.
* gcc.dg/div-cmp-2.c: New test.
Co-Authored-By: Jackson Woodruff <jackson.woodruff@arm.com>
From-SVN: r266142