public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aldyh/heads/ranger-relational)] Enable oracle only if dom info is available.
@ 2021-03-18 15:19 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2021-03-18 15:19 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4871e0cb0fe6966f74ad6bcac4f969e19ab4a072
commit 4871e0cb0fe6966f74ad6bcac4f969e19ab4a072
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Mar 16 08:23:17 2021 +0100
Enable oracle only if dom info is available.
Diff:
---
gcc/gimple-range-cache.cc | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc
index e67bdda6623..298ff030cd9 100644
--- a/gcc/gimple-range-cache.cc
+++ b/gcc/gimple-range-cache.cc
@@ -613,12 +613,16 @@ ranger_cache::ranger_cache (gimple_ranger &q) : query (q)
m_equiv_edge_check.safe_grow_cleared (20);
m_equiv_edge_check.truncate (0);
m_temporal = new temporal_cache (*this);
- m_oracle = new relation_oracle ();
+ if (dom_info_available_p (CDI_DOMINATORS))
+ m_oracle = new relation_oracle ();
+ else
+ m_oracle = NULL;
}
ranger_cache::~ranger_cache ()
{
- delete m_oracle;
+ if (m_oracle)
+ delete m_oracle;
delete m_temporal;
m_equiv_edge_check.release ();
m_poor_value_list.release ();
@@ -648,7 +652,8 @@ ranger_cache::dump (FILE *f, basic_block bb)
{
gori_map::dump (f, bb, false);
m_on_entry.dump (f, bb);
- m_oracle->dump (f, bb);
+ if (m_oracle)
+ m_oracle->dump (f, bb);
}
// Get the global range for NAME, and return in R. Return false if the
@@ -851,6 +856,8 @@ ranger_cache::process_equivs (irange &r, tree name, basic_block bb)
bool ret = false;
m_equiv_edge_check.truncate (0);
+ if (!m_oracle)
+ return false;
const_bitmap equivs = m_oracle->equiv_set (name, bb);
if (!equivs)
return false;
@@ -1216,6 +1223,8 @@ ranger_cache::fill_block_cache (tree name, basic_block bb, basic_block def_bb)
relation_kind
ranger_cache::query_relation (gimple *s, tree op1, tree op2)
{
+ if (!m_oracle)
+ return VREL_NONE;
// If they aren't both ssa names, there is no relation.
if (!gimple_range_ssa_p (op1) || !gimple_range_ssa_p (op2))
return VREL_NONE;
@@ -1228,7 +1237,7 @@ ranger_cache::process_relations (gimple *s, irange &lhs_range,
tree op1, const irange &range1)
{
range_operator *handler = gimple_range_handler (s);
- if (!handler)
+ if (!m_oracle || !handler)
return false;
relation_kind relation = VREL_NONE;
@@ -1246,7 +1255,7 @@ ranger_cache::process_relations (gimple *s, irange &lhs_range,
void
ranger_cache::process_edge_relations (edge e)
{
- if (!single_pred_p (e->dest))
+ if (!m_oracle || !single_pred_p (e->dest))
return;
int_range_max r;
@@ -1341,7 +1350,7 @@ ranger_cache::process_relations (gimple *s, irange &lhs_range,
{
relation_kind relation = VREL_NONE;
range_operator *handler = gimple_range_handler (s);
- if (!handler)
+ if (!m_oracle || !handler)
return false;
tree lhs = gimple_get_lhs (s);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-18 15:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 15:19 [gcc(refs/users/aldyh/heads/ranger-relational)] Enable oracle only if dom info is available Aldy Hernandez
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).