* [PATCH 7/8] Adjust fur_source internal api to use gori_compute not, ranger_cache.
@ 2021-05-25 23:31 Andrew MacLeod
0 siblings, 0 replies; only message in thread
From: Andrew MacLeod @ 2021-05-25 23:31 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
I introduced fur_source a week ago or so to act as the source for
operands of fold_stmt.. ie, it encapsulated a range_query source to get
operands for the arguments of a stmt when fold_stmt was invoked.
One of the API points was an internal ranger version which contains a
reference to a ranger_cache for various dependency set-upo/query
reasons. That has been relocated to gori_compute now, so change that
class to use a gori_compute class reference instead of a ranger_cache
object.
Again, no functional change. Bootstraps on x86_64-pc-linux-gnu with no
regressions. Pushed.
Andrew
[-- Attachment #2: 0007-Adjust-fur_source-internal-api-to-use-gori_compute-n.patch --]
[-- Type: text/x-patch, Size: 4240 bytes --]
From f630797a1ed2f82faf965a47b43b5f995bc6623a Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Tue, 25 May 2021 14:55:04 -0400
Subject: [PATCH 7/8] Adjust fur_source internal api to use gori_compute not
ranger_cache.
In order to access the dependencies, the FoldUsingRange source API class
stored a range_cache.. THis is now contained in the base gori_compute class,
so use that now.
* gimple-range.cc (fold_using_range::range_of_range_op): Use m_gori
intead of m_cache.
(fold_using_range::range_of_address): Adjust.
(fold_using_range::range_of_phi): Adjust.
* gimple-range.h (class fur_source): Adjust.
(fur_source::fur_source): Adjust.
---
gcc/gimple-range.cc | 18 +++++++++---------
gcc/gimple-range.h | 12 ++++++------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 593ddb1c3f8..e2d24d6e451 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -435,17 +435,17 @@ fold_using_range::range_of_range_op (irange &r, gimple *s, fur_source &src)
// Fold range, and register any dependency if available.
int_range<2> r2 (type);
handler->fold_range (r, type, range1, r2);
- if (lhs && src.m_cache)
- src.m_cache->register_dependency (lhs, op1);
+ if (lhs && src.m_gori)
+ src.m_gori->register_dependency (lhs, op1);
}
else if (src.get_operand (range2, op2))
{
// Fold range, and register any dependency if available.
handler->fold_range (r, type, range1, range2);
- if (lhs && src.m_cache)
+ if (lhs && src.m_gori)
{
- src.m_cache->register_dependency (lhs, op1);
- src.m_cache->register_dependency (lhs, op2);
+ src.m_gori->register_dependency (lhs, op1);
+ src.m_gori->register_dependency (lhs, op2);
}
}
else
@@ -485,8 +485,8 @@ fold_using_range::range_of_address (irange &r, gimple *stmt, fur_source &src)
{
tree ssa = TREE_OPERAND (base, 0);
tree lhs = gimple_get_lhs (stmt);
- if (src.m_cache && lhs && gimple_range_ssa_p (ssa))
- src.m_cache->register_dependency (lhs, ssa);
+ if (src.m_gori && lhs && gimple_range_ssa_p (ssa))
+ src.m_gori->register_dependency (lhs, ssa);
gcc_checking_assert (irange::supports_type_p (TREE_TYPE (ssa)));
src.get_operand (r, ssa);
range_cast (r, TREE_TYPE (gimple_assign_rhs1 (stmt)));
@@ -563,8 +563,8 @@ fold_using_range::range_of_phi (irange &r, gphi *phi, fur_source &src)
edge e = gimple_phi_arg_edge (phi, x);
// Register potential dependencies for stale value tracking.
- if (src.m_cache && gimple_range_ssa_p (arg))
- src.m_cache->register_dependency (phi_def, arg);
+ if (src.m_gori && gimple_range_ssa_p (arg))
+ src.m_gori->register_dependency (phi_def, arg);
// Get the range of the argument on its edge.
fur_source e_src (src.m_query, e);
diff --git a/gcc/gimple-range.h b/gcc/gimple-range.h
index 08035a53238..707dcfe027b 100644
--- a/gcc/gimple-range.h
+++ b/gcc/gimple-range.h
@@ -84,10 +84,10 @@ class fur_source
public:
inline fur_source (range_query *q, edge e);
inline fur_source (range_query *q, gimple *s);
- inline fur_source (range_query *q, class ranger_cache *g, edge e, gimple *s);
+ inline fur_source (range_query *q, gori_compute *g, edge e, gimple *s);
bool get_operand (irange &r, tree expr);
protected:
- ranger_cache *m_cache;
+ gori_compute *m_gori;
range_query *m_query;
edge m_edge;
gimple *m_stmt;
@@ -124,7 +124,7 @@ inline
fur_source::fur_source (range_query *q, edge e)
{
m_query = q;
- m_cache = NULL;
+ m_gori = NULL;
m_edge = e;
m_stmt = NULL;
}
@@ -135,7 +135,7 @@ inline
fur_source::fur_source (range_query *q, gimple *s)
{
m_query = q;
- m_cache = NULL;
+ m_gori = NULL;
m_edge = NULL;
m_stmt = s;
}
@@ -144,10 +144,10 @@ fur_source::fur_source (range_query *q, gimple *s)
// and can also set the dependency information as appropriate when invoked.
inline
-fur_source::fur_source (range_query *q, ranger_cache *g, edge e, gimple *s)
+fur_source::fur_source (range_query *q, gori_compute *g, edge e, gimple *s)
{
m_query = q;
- m_cache = g;
+ m_gori = g;
m_edge = e;
m_stmt = s;
}
--
2.17.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-25 23:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 23:31 [PATCH 7/8] Adjust fur_source internal api to use gori_compute not, ranger_cache Andrew MacLeod
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).