aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2021-05-31 16:00:16 -0400
committerAndrew MacLeod <amacleod@redhat.com>2021-05-31 20:49:39 -0400
commit47ea02bb862d6be9a200ebccbd5d64b31a003ec2 (patch)
tree543e1681315c54ab8e488655243b4bb94e5a9a7b /gcc/gimple-range.cc
parent1ffbfc2659e7e8fa5c5d633869870af8fca5e8ee (diff)
downloadgcc-47ea02bb862d6be9a200ebccbd5d64b31a003ec2.zip
gcc-47ea02bb862d6be9a200ebccbd5d64b31a003ec2.tar.gz
gcc-47ea02bb862d6be9a200ebccbd5d64b31a003ec2.tar.bz2
Move Ranger cache to range-query and fur_source model.
Flatten and simplify gori-computes. Tweak debug output. range-cache now provides range_of_expr and range_on_edge in the standard formats, but in a "query what you have" mode rather than "go figure out anything that is missing" mode. * gimple-range-cache.cc (ranger_cache::ranger_cache): Adjust for gori_compute being a member rather than base class. dervied call to member call. (ranger_cache::dump): No longer dump gori_map. (ranger_cache::dump_bb): New. (ranger_cache::get_non_stale_global_range): Adjust for gori_compute being a member rather than base class. (ranger_cache::set_global_range): Ditto. (ranger_cache::ssa_range_in_bb): Ditto. (ranger_cache::range_of_expr): New. (ranger_cache::range_on_edge): New. (ranger_cache::block_range): Adjust for gori_computes. Debug changes. (ranger_cache::propagate_cache): Adjust debugging output. (ranger_cache::fill_block_cache): Adjust for gori_computes. Debug output changes. * gimple-range-cache.h (class ranger_cache): Make gori_compute a member, and inherit from range_query instead. (ranger_cache::dump_bb): New. split from dump. * gimple-range-gori.cc (gori_compute::ssa_range_in_bb): Delete. (gori_compute::expr_range_at_stmt): Delete. (gori_compute::compute_name_range_op): Delete. (gori_compute::compute_operand_range_switch): Add fur_source. (gori_compute::compute_operand_range): Add fur_source param, inline old compute_name_range_op and optimize_logical_operands. (struct tf_range): Delete. (gori_compute::logical_combine): Adjust (gori_compute::optimize_logical_operands): Delete. (gori_compute::compute_logical_operands_in_chain): Delete. (gori_compute::compute_logical_operands): Adjust. (gori_compute::compute_operand1_range): Adjust to fur_source. (gori_compute::compute_operand2_range): Ditto. (gori_compute::compute_operand1_and_operand2_range): Ditto. (gori_compute::outgoing_edge_range_p): Add range_query parameter, and adjust to fur_source. * gimple-range-gori.h (class gori_compute): Simplify and adjust to range_query and fur_source. * gimple-range.cc (gimple_ranger::range_on_edge): Query range_on_edge from the ranger_cache.. (gimple_ranger::fold_range_internal): Adjust to base class change of ranger_cache. (gimple_ranger::dump_bb): Adjust dump. * gimple-range.h (gimple_ranger):export gori computes object.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r--gcc/gimple-range.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index b4dfaa9..d58e151 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -1051,7 +1051,7 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name)
|| range_compatible_p (r.type(), TREE_TYPE (name)));
// Check to see if NAME is defined on edge e.
- if (m_cache.outgoing_edge_range_p (edge_range, e, name))
+ if (m_cache.range_on_edge (edge_range, e, name))
r.intersect (edge_range);
return true;
@@ -1063,7 +1063,7 @@ bool
gimple_ranger::fold_range_internal (irange &r, gimple *s, tree name)
{
fold_using_range f;
- fur_source src (this, &m_cache, NULL, s);
+ fur_source src (this, &(gori ()), NULL, s);
return f.fold_stmt (r, s, src, name);
}
@@ -1164,7 +1164,7 @@ gimple_ranger::dump_bb (FILE *f, basic_block bb)
edge e;
int_range_max range;
fprintf (f, "\n=========== BB %d ============\n", bb->index);
- m_cache.dump (f, bb);
+ m_cache.dump_bb (f, bb);
::dump_bb (f, bb, 4, TDF_NONE);
@@ -1193,7 +1193,7 @@ gimple_ranger::dump_bb (FILE *f, basic_block bb)
for (x = 1; x < num_ssa_names; x++)
{
tree name = gimple_range_ssa_p (ssa_name (x));
- if (name && m_cache.outgoing_edge_range_p (range, e, name))
+ if (name && m_cache.range_on_edge (range, e, name))
{
gimple *s = SSA_NAME_DEF_STMT (name);
// Only print the range if this is the def block, or
@@ -1236,7 +1236,7 @@ gimple_ranger::dump (FILE *f)
FOR_EACH_BB_FN (bb, cfun)
dump_bb (f, bb);
- m_cache.dump (f, false);
+ m_cache.dump (f);
}
// If SCEV has any information about phi node NAME, return it as a range in R.