From ea7df355ca4a4571d07d1fc9528cccd1393c2420 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 2 Nov 2020 17:04:23 -0500 Subject: More Ranger cache tweaks This patch splits the individual value propagation out from fill_block_cache, and calls it from set_global_value when the global value is updated. This ensures the "current" global value is reflected in the on-entry cache. * gimple-range-cache.cc (ssa_global_cache::get_global_range): Return true if there was a previous range set. (ranger_cache::ranger_cache): Take a gimple_ranger parameter. (ranger_cache::set_global_range): Propagate the value if updating. (ranger_cache::propagate_cache): Renamed from iterative_cache_update. (ranger_cache::propagate_updated_value): New. Split from: (ranger_cache::fill_block_cache): Split out value propagator. * gimple-range-cache.h (ssa_global_cache): Update prototypes. (ranger_cache): Update prototypes. --- gcc/gimple-range-cache.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gcc/gimple-range-cache.h') diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h index 599a292..0e84ab0 100644 --- a/gcc/gimple-range-cache.h +++ b/gcc/gimple-range-cache.h @@ -74,7 +74,7 @@ public: ssa_global_cache (); ~ssa_global_cache (); bool get_global_range (irange &r, tree name) const; - void set_global_range (tree name, const irange &r); + bool set_global_range (tree name, const irange &r); void clear_global_range (tree name); void clear (); void dump (FILE *f = stderr); @@ -90,7 +90,7 @@ private: class ranger_cache : public gori_compute_cache { public: - ranger_cache (class range_query &q); + ranger_cache (class gimple_ranger &q); ~ranger_cache (); virtual void ssa_range_in_bb (irange &r, tree name, basic_block bb); @@ -108,7 +108,9 @@ private: block_range_cache m_on_entry; void add_to_update (basic_block bb); void fill_block_cache (tree name, basic_block bb, basic_block def_bb); - void iterative_cache_update (tree name); + void propagate_cache (tree name); + + void propagate_updated_value (tree name, basic_block bb); vec m_workback; vec m_update_list; @@ -121,7 +123,7 @@ private: }; bool push_poor_value (basic_block bb, tree name); vec m_poor_value_list; - class range_query &query; + class gimple_ranger &query; }; #endif // GCC_SSA_RANGE_CACHE_H -- cgit v1.1