aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2024-05-22 19:51:16 -0400
committerAndrew MacLeod <amacleod@redhat.com>2024-05-28 22:36:51 -0400
commita19f588d0b71a4cbc48b064177de87d3ca46b39f (patch)
treeef7ef041372386b188824ec2c0f0ec066ecb2118 /gcc
parente5fc5d42d25c86ae48178db04ce64d340a834614 (diff)
downloadgcc-a19f588d0b71a4cbc48b064177de87d3ca46b39f.zip
gcc-a19f588d0b71a4cbc48b064177de87d3ca46b39f.tar.gz
gcc-a19f588d0b71a4cbc48b064177de87d3ca46b39f.tar.bz2
Gori_on_edge tweaks.
FAST_VRP uses a non-ranger gori_on_edge routine which allows an optional outgoing_edge_range object if one wanted to use switches. This is now integrated with the gori () method of a range_query, and is no longer needed. * gimple-range-gori.cc (gori_on_edge): Always use static ranges from the specified range_query. * gimple-range-gori.h (gori_on_edge): Change prototype. * gimple-range.cc (dom_ranger::maybe_push_edge): Change arguments to call.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-range-gori.cc20
-rw-r--r--gcc/gimple-range-gori.h6
-rw-r--r--gcc/gimple-range.cc2
3 files changed, 9 insertions, 19 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 0d471b4..d489aef 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -1625,28 +1625,20 @@ gori_calc_operands (vrange &lhs, gimple *stmt, ssa_cache &r, range_query *q)
}
// Use ssa_cache R as a repository for all outgoing ranges on edge E that
-// can be calculated. Use OGR if present to establish starting edge ranges,
-// and Q to resolve operand values. If Q is NULL use the current range
+// can be calculated. Use Q to establish starting edge ranges anbd to resolve
+// operand values. If Q is NULL use the current range
// query available to the system.
bool
-gori_on_edge (ssa_cache &r, edge e, range_query *q, gimple_outgoing_range *ogr)
+gori_on_edge (ssa_cache &r, edge e, range_query *q)
{
+ if (!q)
+ q = get_range_query (cfun);
// Start with an empty vector
r.clear ();
int_range_max lhs;
// Determine if there is an outgoing edge.
- gimple *stmt;
- if (ogr)
- stmt = ogr->edge_range_p (lhs, e);
- else
- {
- stmt = gimple_outgoing_range_stmt_p (e->src);
- if (stmt && is_a<gcond *> (stmt))
- gcond_edge_range (lhs, e);
- else
- stmt = NULL;
- }
+ gimple *stmt = q->gori ().edge_range_p (lhs, e);
if (!stmt)
return false;
gori_calc_operands (lhs, stmt, r, q);
diff --git a/gcc/gimple-range-gori.h b/gcc/gimple-range-gori.h
index 9b4bcd9..11019e3 100644
--- a/gcc/gimple-range-gori.h
+++ b/gcc/gimple-range-gori.h
@@ -213,10 +213,8 @@ private:
// ssa_cache structure).
// GORI_NAME_ON_EDGE is used to simply ask if NAME has a range on edge E
-// Fill ssa-cache R with any outgoing ranges on edge E, using OGR and QUERY.
-bool gori_on_edge (class ssa_cache &r, edge e,
- range_query *query = NULL,
- gimple_outgoing_range *ogr = NULL);
+// Fill ssa-cache R with any outgoing ranges on edge E, using QUERY.
+bool gori_on_edge (class ssa_cache &r, edge e, range_query *query = NULL);
// Query if NAME has an outgoing range on edge E, and return it in R if so.
// Note this doesnt use ranger, its a static GORI analysis of the range in
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 711646a..be22bb4 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -1156,7 +1156,7 @@ dom_ranger::maybe_push_edge (edge e, bool edge_0)
e_cache = m_freelist.pop ();
else
e_cache = new ssa_lazy_cache;
- gori_on_edge (*e_cache, e, this, &gori ());
+ gori_on_edge (*e_cache, e, this);
if (e_cache->empty_p ())
m_freelist.safe_push (e_cache);
else