diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2020-11-04 12:59:15 -0500 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2020-11-04 13:07:53 -0500 |
commit | e86fd6a17cdb26710d1f13c9a47a3878c76028f9 (patch) | |
tree | 28e836b34524e1129f1ceb70527d301c8483fe53 /gcc/gimple-range-cache.h | |
parent | 9c1125c121423a9948fa39e71ef89ba4059a2fad (diff) | |
download | gcc-e86fd6a17cdb26710d1f13c9a47a3878c76028f9.zip gcc-e86fd6a17cdb26710d1f13c9a47a3878c76028f9.tar.gz gcc-e86fd6a17cdb26710d1f13c9a47a3878c76028f9.tar.bz2 |
Add Ranger temporal cache
Add a timestamp to supplement the global range cache to detect when a value
may become stale.
gcc/
PR tree-optimization/97515
* gimple-range-cache.h (class ranger_cache): New prototypes plus
temporal cache pointer.
* gimple-range-cache.cc (struct range_timestamp): New.
(class temporal_cache): New.
(temporal_cache::temporal_cache): New.
(temporal_cache::~temporal_cache): New.
(temporal_cache::get_timestamp): New.
(temporal_cache::set_dependency): New.
(temporal_cache::temporal_value): New.
(temporal_cache::current_p): New.
(temporal_cache::set_timestamp): New.
(temporal_cache::set_always_current): New.
(ranger_cache::ranger_cache): Allocate the temporal cache.
(ranger_cache::~ranger_cache): Free temporal cache.
(ranger_cache::get_non_stale_global_range): New.
(ranger_cache::set_global_range): Add a timestamp.
(ranger_cache::register_dependency): New. Add timestamp dependency.
* gimple-range.cc (gimple_ranger::range_of_range_op): Add operand
dependencies.
(gimple_ranger::range_of_phi): Ditto.
(gimple_ranger::range_of_stmt): Check if global range is stale, and
recalculate if so.
gcc/testsuite/
* gcc.dg/pr97515.c: Check listing for folding of entire function.
Diffstat (limited to 'gcc/gimple-range-cache.h')
-rw-r--r-- | gcc/gimple-range-cache.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h index 0e84ab0..c5749fe 100644 --- a/gcc/gimple-range-cache.h +++ b/gcc/gimple-range-cache.h @@ -97,7 +97,9 @@ public: bool block_range (irange &r, basic_block bb, tree name, bool calc = true); bool get_global_range (irange &r, tree name) const; + bool get_non_stale_global_range (irange &r, tree name); void set_global_range (tree name, const irange &r); + void register_dependency (tree name, tree dep); non_null_ref m_non_null; @@ -106,6 +108,7 @@ public: private: ssa_global_cache m_globals; block_range_cache m_on_entry; + class temporal_cache *m_temporal; void add_to_update (basic_block bb); void fill_block_cache (tree name, basic_block bb, basic_block def_bb); void propagate_cache (tree name); |