diff options
author | Jackson Woodruff <jackson.woodruff@arm.com> | 2017-11-24 16:03:13 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2017-11-24 16:03:13 +0000 |
commit | 19cf3a368544af31e3791c27e3c9be9b01e71851 (patch) | |
tree | 4a8138b582ded97f36d36a37fd7c48fe089bb91d /gcc/fortran/trans-openmp.c | |
parent | 15b6695ac534148a10dd5a5f266bf2e49316dc32 (diff) | |
download | gcc-19cf3a368544af31e3791c27e3c9be9b01e71851.zip gcc-19cf3a368544af31e3791c27e3c9be9b01e71851.tar.gz gcc-19cf3a368544af31e3791c27e3c9be9b01e71851.tar.bz2 |
Factor out division by squares
This patch implements the some of the division optimizations discussed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026.
The division reciprocal optimization now handles divisions by squares:
x / (y * y) -> x * (1 / y) * (1 / y)
This requires at least one more division by y before it triggers - the
3 divisions of (1/ y) are then CSEd into a single division. Overall
this changes 1 division into 1 multiply, which is generally much faster.
2017-11-24 Jackson Woodruff <jackson.woodruff@arm.com>
gcc/
PR tree-optimization/71026
* tree-ssa-math-opts (is_division_by_square, is_square_of): New.
(insert_reciprocals): Change to insert reciprocals before a division
by a square and to insert the square of a reciprocal.
(execute_cse_reciprocals_1): Change to consider division by a square.
(register_division_in): Add importance parameter.
testsuite/
PR tree-optimization/71026
* gfortran.dg/extract_recip_1.f: New test.
* gcc.dg/extract_recip_3.c: New test.
* gcc.dg/extract_recip_4.c: New test.
From-SVN: r255141
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
0 files changed, 0 insertions, 0 deletions