diff options
Diffstat (limited to 'gcc/tree-ssa-threadedge.cc')
-rw-r--r-- | gcc/tree-ssa-threadedge.cc | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/gcc/tree-ssa-threadedge.cc b/gcc/tree-ssa-threadedge.cc index e64e4f2..905a98c 100644 --- a/gcc/tree-ssa-threadedge.cc +++ b/gcc/tree-ssa-threadedge.cc @@ -1399,7 +1399,6 @@ jt_state::register_equivs_stmt (gimple *stmt, basic_block bb, // Hybrid threader implementation. - hybrid_jt_simplifier::hybrid_jt_simplifier (gimple_ranger *r, path_range_query *q) { @@ -1411,7 +1410,12 @@ tree hybrid_jt_simplifier::simplify (gimple *stmt, gimple *, basic_block, jt_state *state) { - compute_ranges_from_state (stmt, state); + auto_bitmap dependencies; + auto_vec<basic_block> path; + + state->get_path (path); + compute_exit_dependencies (dependencies, path, stmt); + m_query->reset_path (path, dependencies); if (gimple_code (stmt) == GIMPLE_COND || gimple_code (stmt) == GIMPLE_ASSIGN) @@ -1432,22 +1436,25 @@ hybrid_jt_simplifier::simplify (gimple *stmt, gimple *, basic_block, return NULL; } -// Use STATE to generate the list of imports needed for the solver, -// and calculate the ranges along the path. +// Calculate the set of exit dependencies for a path and statement to +// be simplified. This is different than the +// compute_exit_dependencies in the path solver because the forward +// threader asks questions about statements not necessarily in the +// path. Using the default compute_exit_dependencies in the path +// solver gets noticeably less threads. void -hybrid_jt_simplifier::compute_ranges_from_state (gimple *stmt, jt_state *state) +hybrid_jt_simplifier::compute_exit_dependencies (bitmap dependencies, + const vec<basic_block> &path, + gimple *stmt) { - auto_bitmap imports; gori_compute &gori = m_ranger->gori (); - state->get_path (m_path); - // Start with the imports to the final conditional. - bitmap_copy (imports, gori.imports (m_path[0])); + bitmap_copy (dependencies, gori.imports (path[0])); // Add any other interesting operands we may have missed. - if (gimple_bb (stmt) != m_path[0]) + if (gimple_bb (stmt) != path[0]) { for (unsigned i = 0; i < gimple_num_ops (stmt); ++i) { @@ -1455,8 +1462,7 @@ hybrid_jt_simplifier::compute_ranges_from_state (gimple *stmt, jt_state *state) if (op && TREE_CODE (op) == SSA_NAME && Value_Range::supports_type_p (TREE_TYPE (op))) - bitmap_set_bit (imports, SSA_NAME_VERSION (op)); + bitmap_set_bit (dependencies, SSA_NAME_VERSION (op)); } } - m_query->compute_ranges (m_path, imports); } |