diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-03-28 11:35:26 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-04-26 15:17:08 -0400 |
commit | 0a38f677463ff8a4fb61b049263aa596ef6471a7 (patch) | |
tree | 28f6ae3086f4e023f3ea48f49e4086776e4995ef /gcc/gimple-range-path.h | |
parent | 8a3590e5ce8fcc6b381d9572edbca6157bd67cfd (diff) | |
download | gcc-0a38f677463ff8a4fb61b049263aa596ef6471a7.zip gcc-0a38f677463ff8a4fb61b049263aa596ef6471a7.tar.gz gcc-0a38f677463ff8a4fb61b049263aa596ef6471a7.tar.bz2 |
Create a lazy ssa_cache.
Sparsely used ssa caches can benefit from using a bitmap to
determine if a name already has an entry. Utilize it in the path query
and remove its private bitmap for tracking the same info.
Also use it in the "assume" query class.
PR tree-optimization/108697
* gimple-range-cache.cc (ssa_global_cache::clear_range): Do
not clear the vector on an out of range query.
(ssa_cache::dump): Use dump_range_query instead of get_range.
(ssa_cache::dump_range_query): New.
(ssa_lazy_cache::dump_range_query): New.
(ssa_lazy_cache::set_range): New.
* gimple-range-cache.h (ssa_cache::dump_range_query): New.
(class ssa_lazy_cache): New.
(ssa_lazy_cache::ssa_lazy_cache): New.
(ssa_lazy_cache::~ssa_lazy_cache): New.
(ssa_lazy_cache::get_range): New.
(ssa_lazy_cache::clear_range): New.
(ssa_lazy_cache::clear): New.
(ssa_lazy_cache::dump): New.
* gimple-range-path.cc (path_range_query::path_range_query): Do
not allocate a ssa_cache object nor has_cache bitmap.
(path_range_query::~path_range_query): Do not free objects.
(path_range_query::clear_cache): Remove.
(path_range_query::get_cache): Adjust.
(path_range_query::set_cache): Remove.
(path_range_query::dump): Don't call through a pointer.
(path_range_query::internal_range_of_expr): Set cache directly.
(path_range_query::reset_path): Clear cache directly.
(path_range_query::ssa_range_in_phi): Fold with globals only.
(path_range_query::compute_ranges_in_phis): Simply set range.
(path_range_query::compute_ranges_in_block): Call cache directly.
* gimple-range-path.h (class path_range_query): Replace bitmap
and cache pointer with lazy cache object.
* gimple-range.h (class assume_query): Use ssa_lazy_cache.
Diffstat (limited to 'gcc/gimple-range-path.h')
-rw-r--r-- | gcc/gimple-range-path.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h index 29e33c6..34841e7 100644 --- a/gcc/gimple-range-path.h +++ b/gcc/gimple-range-path.h @@ -54,9 +54,7 @@ private: path_oracle *get_path_oracle () { return (path_oracle *)m_oracle; } // Cache manipulation. - void set_cache (const vrange &r, tree name); bool get_cache (vrange &r, tree name); - void clear_cache (tree name); // Methods to compute ranges for the given path. bool range_defined_in_block (vrange &, tree name, basic_block bb); @@ -83,10 +81,7 @@ private: void move_next () { --m_pos; } // Range cache for SSA names. - ssa_cache *m_cache; - - // Set for each SSA that has an active entry in the cache. - bitmap m_has_cache_entry; + ssa_lazy_cache m_cache; // Path being analyzed. auto_vec<basic_block> m_path; |