aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2021-11-22 14:39:41 -0500
committerAndrew MacLeod <amacleod@redhat.com>2021-11-24 09:03:07 -0500
commit5deacf6058d1bc7261a75c9fd1f116c4442e9e60 (patch)
tree67b0f322e0f6a1dab9869f449fcf5be8e1aac7b2 /gcc/gimple-range.h
parentd986ff50b4aad62c45d7ac62915e072643ddfca1 (diff)
downloadgcc-5deacf6058d1bc7261a75c9fd1f116c4442e9e60.zip
gcc-5deacf6058d1bc7261a75c9fd1f116c4442e9e60.tar.gz
gcc-5deacf6058d1bc7261a75c9fd1f116c4442e9e60.tar.bz2
Directly resolve range_of_stmt dependencies.
All ranger API entries eventually call range_of_stmt to ensure there is an initial global value to work with. This can cause very deep call chains when satisfied via the normal API. Instead, push any dependencies onto a stack and evaluate them in a depth first manner, mirroring what would have happened via the normal API calls. PR tree-optimization/103231 gcc/ * gimple-range.cc (gimple_ranger::gimple_ranger): Create stmt stack. (gimple_ranger::gimple_ranger): Delete stmt stack. (gimple_ranger::range_of_stmt): Process depenedencies if they have no global cache entry. (gimple_ranger::prefill_name): New. (gimple_ranger::prefill_stmt_dependencies): New. * gimple-range.h (class gimple_ranger): Add prototypes.
Diffstat (limited to 'gcc/gimple-range.h')
-rw-r--r--gcc/gimple-range.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index 615496e..c2923c5 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -47,6 +47,7 @@ class gimple_ranger : public range_query
{
public:
gimple_ranger ();
+ ~gimple_ranger ();
virtual bool range_of_stmt (irange &r, gimple *, tree name = NULL) OVERRIDE;
virtual bool range_of_expr (irange &r, tree name, gimple * = NULL) OVERRIDE;
virtual bool range_on_edge (irange &r, edge e, tree name) OVERRIDE;
@@ -61,9 +62,12 @@ public:
bool fold_stmt (gimple_stmt_iterator *gsi, tree (*) (tree));
protected:
bool fold_range_internal (irange &r, gimple *s, tree name);
+ void prefill_name (irange &r, tree name);
+ void prefill_stmt_dependencies (tree ssa);
ranger_cache m_cache;
range_tracer tracer;
basic_block current_bb;
+ vec<tree> m_stmt_list;
};
/* Create a new ranger instance and associate it with a function.