diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2018-11-14 12:45:29 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2018-11-14 12:45:29 +0000 |
commit | 5e21d7651ef002ba2ca0ad3038b8736c47919471 (patch) | |
tree | 5586a58c4cc31595b4cdedf33ea852fd97d90fc8 /gcc/tree-data-ref.c | |
parent | 8cca0163fb468842f85ac8e8638ea6d1ca2f9181 (diff) | |
download | gcc-5e21d7651ef002ba2ca0ad3038b8736c47919471.zip gcc-5e21d7651ef002ba2ca0ad3038b8736c47919471.tar.gz gcc-5e21d7651ef002ba2ca0ad3038b8736c47919471.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-data-ref.c')
0 files changed, 0 insertions, 0 deletions