aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-cache.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2022-03-24 15:28:43 -0400
committerAndrew MacLeod <amacleod@redhat.com>2022-05-13 09:45:35 -0400
commit6b156044c12bc4582511fe270b10450c943476dd (patch)
tree7e588128b0f0f94d8386f248f8dac1812490257c /gcc/gimple-range-cache.h
parentb584cbdb0829bb0ad4e6ed7488a304ae4e76b870 (diff)
downloadgcc-6b156044c12bc4582511fe270b10450c943476dd.zip
gcc-6b156044c12bc4582511fe270b10450c943476dd.tar.gz
gcc-6b156044c12bc4582511fe270b10450c943476dd.tar.bz2
Make range_from_dom more effective.
Add modes to range_from_dom such that we can simply query, or adjust the cache and deal with multiple predecessor blocks. * gimple-range-cache.cc (ranger_cache::ranger_cache): Start with worlist truncated. (ranger_cache::entry_range): Add rfd_mode parameter. (ranger_cache::exit_range): Ditto. (ranger_cache::edge_range): New. Incorporate from range_on_edge. (ranger_cache::range_of_expr): Adjust call to entry_range. (ranger_cache::range_on_edge): Split to edge_range and call. (ranger_cache::fill_block_cache): Always invoke range_from_dom. (ranger_cache::range_from_dom): Make reentrant, add search mode, handle mutiple predecessors. (ranger_cache::update_to_nonnull): Adjust call to exit_range. * gimple-range-cache.h (ranger_cache): Add enum rfd_mode. Adjust prototypes.
Diffstat (limited to 'gcc/gimple-range-cache.h')
-rw-r--r--gcc/gimple-range-cache.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/gimple-range-cache.h b/gcc/gimple-range-cache.h
index a0244e4..560403b 100644
--- a/gcc/gimple-range-cache.h
+++ b/gcc/gimple-range-cache.h
@@ -129,7 +129,6 @@ public:
virtual bool range_of_expr (irange &r, tree name, gimple *stmt);
virtual bool range_on_edge (irange &r, edge e, tree expr);
bool block_range (irange &r, basic_block bb, tree name, bool calc = true);
- bool range_from_dom (irange &r, tree name, basic_block bb);
bool get_global_range (irange &r, tree name) const;
bool get_global_range (irange &r, tree name, bool &current_p);
@@ -151,9 +150,17 @@ private:
void fill_block_cache (tree name, basic_block bb, basic_block def_bb);
void propagate_cache (tree name);
+ enum rfd_mode
+ {
+ RFD_NONE, // Only look at current block cache.
+ RFD_READ_ONLY, // Scan DOM tree, do not write to cache.
+ RFD_FILL // Scan DOM tree, updating important nodes.
+ };
+ bool range_from_dom (irange &r, tree name, basic_block bb, enum rfd_mode);
void range_of_def (irange &r, tree name, basic_block bb = NULL);
- void entry_range (irange &r, tree expr, basic_block bb);
- void exit_range (irange &r, tree expr, basic_block bb);
+ void entry_range (irange &r, tree expr, basic_block bb, enum rfd_mode);
+ void exit_range (irange &r, tree expr, basic_block bb, enum rfd_mode);
+ bool edge_range (irange &r, edge e, tree name, enum rfd_mode);
vec<basic_block> m_workback;
class update_list *m_update;