aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-cache.h
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-cache.h
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-cache.h')
-rw-r--r--gcc/gimple-range-cache.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h
index fe781e0..ac50219 100644
--- a/gcc/gimple-range-cache.h
+++ b/gcc/gimple-range-cache.h
@@ -86,13 +86,15 @@ private:
// them available for gori-computes to query so outgoing edges can be
// properly calculated.
-class ranger_cache : public gori_compute
+class ranger_cache : public range_query
{
public:
ranger_cache (class gimple_ranger &q);
~ranger_cache ();
- virtual void ssa_range_in_bb (irange &r, tree name, basic_block bb);
+ virtual bool range_of_expr (irange &r, tree expr, gimple *stmt);
+ virtual bool range_on_edge (irange &r, edge e, tree expr);
+ void ssa_range_in_bb (irange &r, tree name, basic_block bb);
bool block_range (irange &r, basic_block bb, tree name, bool calc = true);
bool get_global_range (irange &r, tree name) const;
@@ -100,9 +102,10 @@ public:
void set_global_range (tree name, const irange &r);
non_null_ref m_non_null;
+ gori_compute m_gori;
- void dump (FILE *f, bool dump_gori = true);
- void dump (FILE *f, basic_block bb);
+ void dump_bb (FILE *f, basic_block bb);
+ virtual void dump (FILE *f) OVERRIDE;
private:
ssa_global_cache m_globals;
block_range_cache m_on_entry;