diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2018-09-14 13:13:14 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2018-09-14 13:13:14 +0000 |
commit | 115b470829a7d3ad0c60ea0e09fefef61d50b437 (patch) | |
tree | 9263b042d8a51e68a058597e8972bae8b64c3ca8 /gcc/tree-ssa-math-opts.c | |
parent | 310ee703a20393d2278ff4c08e6f97bd16198564 (diff) | |
download | gcc-115b470829a7d3ad0c60ea0e09fefef61d50b437.zip gcc-115b470829a7d3ad0c60ea0e09fefef61d50b437.tar.gz gcc-115b470829a7d3ad0c60ea0e09fefef61d50b437.tar.bz2 |
[tree-ssa-mathopts] PR tree-optimization/87259: Call execute_cse_reciprocals_1 before trying optimize_recip_sqrt
PR tree-optimization/87259
PR lto/87283
(pass_cse_reciprocals::execute): Run optimize_recip_sqrt after
execute_cse_reciprocals_1 has tried transforming.
PR tree-optimization/87259
* gcc.dg/pr87259.c: New test.
From-SVN: r264312
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 19bff5c..e5aa531 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -547,7 +547,7 @@ free_bb (struct occurrence *occ) depending on the uses of x, r1, r2. This removes one multiplication and allows the sqrt and division operations to execute in parallel. DEF_GSI is the gsi of the initial division by sqrt that defines - DEF (x in the example abovs). */ + DEF (x in the example above). */ static void optimize_recip_sqrt (gimple_stmt_iterator *def_gsi, tree def) @@ -947,13 +947,13 @@ pass_cse_reciprocals::execute (function *fun) && FLOAT_TYPE_P (TREE_TYPE (def)) && TREE_CODE (def) == SSA_NAME) { + execute_cse_reciprocals_1 (&gsi, def); + stmt = gsi_stmt (gsi); if (flag_unsafe_math_optimizations && is_gimple_assign (stmt) && !stmt_can_throw_internal (stmt) && gimple_assign_rhs_code (stmt) == RDIV_EXPR) optimize_recip_sqrt (&gsi, def); - else - execute_cse_reciprocals_1 (&gsi, def); } } |