{
m_gori.gori_map::dump (f, bb, false);
m_on_entry.dump (f, bb);
- m_oracle->dump (f, bb);
+ m_relation->dump (f, bb);
}
// Get the global range for NAME, and return in R. Return false if the
tree equiv_name;
relation_kind rel;
int prec = TYPE_PRECISION (type);
- FOR_EACH_PARTIAL_AND_FULL_EQUIV (m_oracle, bb, name, equiv_name, rel)
+ FOR_EACH_PARTIAL_AND_FULL_EQUIV (m_relation, bb, name, equiv_name, rel)
{
basic_block equiv_bb = gimple_bb (SSA_NAME_DEF_STMT (equiv_name));
relation_kind
fur_stmt::query_relation (tree op1, tree op2)
{
- return m_query->oracle ().query_relation (m_stmt, op1, op2);
+ return m_query->relation ().query (m_stmt, op1, op2);
}
// Instantiate a stmt based fur_source with a GORI object.
void
fur_depend::register_relation (gimple *s, relation_kind k, tree op1, tree op2)
{
- m_query->oracle ().register_relation (s, k, op1, op2);
+ m_query->relation ().record (s, k, op1, op2);
}
// Register a relation on an edge if there is an oracle.
void
fur_depend::register_relation (edge e, relation_kind k, tree op1, tree op2)
{
- m_query->oracle ().register_relation (e, k, op1, op2);
+ m_query->relation ().record (e, k, op1, op2);
}
// This version of fur_source will pick a range up from a list of ranges
tree single_arg = NULL_TREE;
bool seen_arg = false;
- relation_oracle *oracle = &(src.query()->oracle ());
+ relation_oracle *oracle = &(src.query()->relation ());
// Start with an empty range, unioning in each argument's range.
r.set_undefined ();
for (x = 0; x < gimple_phi_num_args (phi); x++)
// Likewise, if the incoming PHI argument is equivalent to this
// PHI definition, it provides no new info. Accumulate these ranges
// in case all arguments are equivalences.
- if (oracle->query_relation (e, arg, phi_def) == VREL_EQ)
+ if (oracle->query (e, arg, phi_def) == VREL_EQ)
equiv_range.union_(arg_range);
else
r.union_ (arg_range);
m_ranger (ranger),
m_resolve (resolve)
{
- m_oracle = new path_oracle (&(m_ranger.oracle ()));
+ m_relation = new path_oracle (&(m_ranger.relation ()));
reset_path (path, dependencies);
}
m_ranger (ranger),
m_resolve (resolve)
{
- m_oracle = new path_oracle (&(m_ranger.oracle ()));
+ m_relation = new path_oracle (&(m_ranger.relation ()));
}
path_range_query::~path_range_query ()
{
- delete m_oracle;
- m_oracle = NULL;
+ delete m_relation;
+ m_relation = NULL;
}
// Return TRUE if NAME is an exit dependency for the path.
if (m_resolve)
{
path_oracle *p = get_path_oracle ();
- p->reset_path (&(m_ranger.oracle ()));
+ p->reset_path (&(m_ranger.relation ()));
}
if (DEBUG_SOLVER)
void
jt_fur_source::register_relation (gimple *, relation_kind k, tree op1, tree op2)
{
- m_query->oracle ().register_relation (m_entry, k, op1, op2);
+ m_query->relation ().record (m_entry, k, op1, op2);
}
// Ignore edge and register relation on entry to path.
void
jt_fur_source::register_relation (edge, relation_kind k, tree op1, tree op2)
{
- m_query->oracle ().register_relation (m_entry, k, op1, op2);
+ m_query->relation ().record (m_entry, k, op1, op2);
}
relation_kind
if (TREE_CODE (op1) != SSA_NAME || TREE_CODE (op2) != SSA_NAME)
return VREL_VARYING;
- return m_query->oracle().query_relation (m_entry, op1, op2);
+ return m_query->relation ().query (m_entry, op1, op2);
}
// Return the range of STMT at the end of the path being analyzed.
fprintf (dump_file, "maybe_register_phi_relation in bb%d:", bb->index);
get_path_oracle ()->killing_def (result);
- m_oracle->register_relation (entry_bb (), VREL_EQ, arg, result);
+ m_relation->record (entry_bb (), VREL_EQ, arg, result);
}
// Compute relations for each PHI in BB. For example:
void compute_exit_dependencies (bitmap_head *dependencies);
bool defined_outside_path (tree name);
void range_on_path_entry (vrange &r, tree name);
- path_oracle *get_path_oracle () { return (path_oracle *)m_oracle; }
+ path_oracle *get_path_oracle () { return (path_oracle *)m_relation; }
// Cache manipulation.
bool get_cache (vrange &r, tree name);
current_bb (NULL)
{
// Share the oracle from the cache.
- m_oracle = &m_cache.oracle ();
+ m_relation = &m_cache.relation ();
if (dump_file && (param_ranger_debug & RANGER_DEBUG_TRACE))
tracer.enable_trace ();
m_stmt_list.create (0);
gimple_ranger::~gimple_ranger ()
{
// Restore the original oracle.
- m_oracle = NULL;
+ m_relation = NULL;
m_stmt_list.release ();
}
range_query::create_relation_oracle ()
{
gcc_checking_assert (this != &global_ranges);
- gcc_checking_assert (m_oracle == &default_relation_oracle);
+ gcc_checking_assert (m_relation == &default_relation_oracle);
if (!dom_info_available_p (CDI_DOMINATORS))
return;
- m_oracle = new dom_oracle ();
- gcc_checking_assert (m_oracle);
+ m_relation = new dom_oracle ();
+ gcc_checking_assert (m_relation);
}
// Destroy any relation oracle that was created.
void
range_query::destroy_relation_oracle ()
{
- // m_oracle can be NULL if a derived range_query class took care of
+ // m_relation can be NULL if a derived range_query class took care of
// disposing its own oracle.
- if (m_oracle && m_oracle != &default_relation_oracle)
+ if (m_relation && m_relation != &default_relation_oracle)
{
- delete m_oracle;
- m_oracle = &default_relation_oracle;
+ delete m_relation;
+ m_relation = &default_relation_oracle;
}
}
range_query::range_query ()
{
- m_oracle = &default_relation_oracle;
+ m_relation = &default_relation_oracle;
}
range_query::~range_query ()
virtual bool range_on_entry (vrange &r, basic_block bb, tree expr);
virtual bool range_on_exit (vrange &r, basic_block bb, tree expr);
- inline class relation_oracle &oracle () const { return *m_oracle; }
+ inline class relation_oracle &relation () const { return *m_relation; }
void create_relation_oracle ();
void destroy_relation_oracle ();
bool invoke_range_of_expr (vrange &v, tree expr, gimple *stmt,
basic_block bbentry, basic_block bbexit);
bool get_arith_expr_range (vrange &r, tree expr, gimple *stmt);
- relation_oracle *m_oracle;
+ relation_oracle *m_relation;
};
// Global ranges for SSA names using SSA_NAME_RANGE_INFO.
// the definitions have been processed and any relations have be created.
relation_kind
-relation_oracle::query_relation (gimple *s, tree ssa1, tree ssa2)
+relation_oracle::query (gimple *s, tree ssa1, tree ssa2)
{
if (TREE_CODE (ssa1) != SSA_NAME || TREE_CODE (ssa2) != SSA_NAME)
return VREL_VARYING;
- return query_relation (gimple_bb (s), ssa1, ssa2);
+ return query (gimple_bb (s), ssa1, ssa2);
}
// Return any known relation between SSA1 and SSA2 on edge E.
// the definitions have been processed and any relations have be created.
relation_kind
-relation_oracle::query_relation (edge e, tree ssa1, tree ssa2)
+relation_oracle::query (edge e, tree ssa1, tree ssa2)
{
basic_block bb;
if (TREE_CODE (ssa1) != SSA_NAME || TREE_CODE (ssa2) != SSA_NAME)
else
bb = e->dest;
- return query_relation (bb, ssa1, ssa2);
+ return query (bb, ssa1, ssa2);
}
// -------------------------------------------------------------------------
// Query if there is a relation (equivalence) between 2 SSA_NAMEs.
relation_kind
-equiv_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2)
+equiv_oracle::query (basic_block bb, tree ssa1, tree ssa2)
{
// If the 2 ssa names share the same equiv set, they are equal.
if (equiv_set (ssa1, bb) == equiv_set (ssa2, bb))
// Query if there is a relation (equivalence) between 2 SSA_NAMEs.
relation_kind
-equiv_oracle::query_relation (basic_block bb ATTRIBUTE_UNUSED, const_bitmap e1,
- const_bitmap e2)
+equiv_oracle::query (basic_block bb ATTRIBUTE_UNUSED, const_bitmap e1,
+ const_bitmap e2)
{
// If the 2 ssa names share the same equiv set, they are equal.
if (bitmap_equal_p (e1, e2))
// containing all the ssa_names in this basic block.
void
-equiv_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1,
- tree ssa2)
+equiv_oracle::record (basic_block bb, relation_kind k, tree ssa1, tree ssa2)
{
// Process partial equivalencies.
if (relation_partial_equiv_p (k))
// Register relation K between ssa_name OP1 and OP2 on STMT.
void
-relation_oracle::register_relation (gimple *stmt, relation_kind k, tree op1,
- tree op2)
+relation_oracle::record (gimple *stmt, relation_kind k, tree op1, tree op2)
{
gcc_checking_assert (TREE_CODE (op1) == SSA_NAME);
gcc_checking_assert (TREE_CODE (op2) == SSA_NAME);
return;
}
}
- register_relation (gimple_bb (stmt), k, op1, op2);
+ record (gimple_bb (stmt), k, op1, op2);
}
// Register relation K between ssa_name OP1 and OP2 on edge E.
void
-relation_oracle::register_relation (edge e, relation_kind k, tree op1, tree op2)
+relation_oracle::record (edge e, relation_kind k, tree op1, tree op2)
{
gcc_checking_assert (TREE_CODE (op1) == SSA_NAME);
gcc_checking_assert (TREE_CODE (op2) == SSA_NAME);
fprintf (dump_file, " on (%d->%d)\n", e->src->index, e->dest->index);
}
- register_relation (e->dest, k, op1, op2);
+ record (e->dest, k, op1, op2);
}
// Register relation K between OP! and OP2 in block BB.
// tree to merge with.
void
-dom_oracle::register_relation (basic_block bb, relation_kind k, tree op1,
- tree op2)
+dom_oracle::record (basic_block bb, relation_kind k, tree op1, tree op2)
{
// If the 2 ssa_names are the same, do nothing. An equivalence is implied,
// and no other relation makes sense.
// Equivalencies are handled by the equivalence oracle.
if (relation_equiv_p (k))
- equiv_oracle::register_relation (bb, k, op1, op2);
+ equiv_oracle::record (bb, k, op1, op2);
else
{
// if neither op1 nor op2 are in a relation before this is registered,
// and B2, starting with block BB.
relation_kind
-dom_oracle::query_relation (basic_block bb, const_bitmap b1,
- const_bitmap b2)
+dom_oracle::query (basic_block bb, const_bitmap b1, const_bitmap b2)
{
relation_kind r;
if (bitmap_equal_p (b1, b2))
// dominator of BB
relation_kind
-dom_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2)
+dom_oracle::query (basic_block bb, tree ssa1, tree ssa2)
{
relation_kind kind;
unsigned v1 = SSA_NAME_VERSION (ssa1);
return kind;
// Query using the equivalence sets.
- kind = query_relation (bb, equiv1, equiv2);
+ kind = query (bb, equiv1, equiv2);
return kind;
}
// querying from BB.
void
-path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1,
- tree ssa2)
+path_oracle::record (basic_block bb, relation_kind k, tree ssa1, tree ssa2)
{
// If the 2 ssa_names are the same, do nothing. An equivalence is implied,
// and no other relation makes sense.
fprintf (dump_file, " (root: bb%d)\n", bb->index);
}
- relation_kind curr = query_relation (bb, ssa1, ssa2);
+ relation_kind curr = query (bb, ssa1, ssa2);
if (curr != VREL_VARYING)
k = relation_intersect (curr, k);
// starting at block BB.
relation_kind
-path_oracle::query_relation (basic_block bb, const_bitmap b1, const_bitmap b2)
+path_oracle::query (basic_block bb, const_bitmap b1, const_bitmap b2)
{
if (bitmap_equal_p (b1, b2))
return VREL_EQ;
return k;
if (k == VREL_VARYING && m_root)
- k = m_root->query_relation (bb, b1, b2);
+ k = m_root->query (bb, b1, b2);
return k;
}
// starting at block BB.
relation_kind
-path_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2)
+path_oracle::query (basic_block bb, tree ssa1, tree ssa2)
{
unsigned v1 = SSA_NAME_VERSION (ssa1);
unsigned v2 = SSA_NAME_VERSION (ssa2);
if (bitmap_bit_p (equiv_1, v2) && bitmap_bit_p (equiv_2, v1))
return VREL_EQ;
- return query_relation (bb, equiv_1, equiv_2);
+ return query (bb, equiv_1, equiv_2);
}
// Reset any relations registered on this path. ORACLE is the root
virtual ~relation_oracle () { }
// register a relation between 2 ssa names.
- void register_relation (gimple *, relation_kind, tree, tree);
- void register_relation (edge, relation_kind, tree, tree);
- virtual void register_relation (basic_block, relation_kind, tree, tree) { }
+ void record (gimple *, relation_kind, tree, tree);
+ void record (edge, relation_kind, tree, tree);
+ virtual void record (basic_block, relation_kind, tree, tree) { }
// Query if there is any relation between SSA1 and SSA2.
- relation_kind query_relation (gimple *s, tree ssa1, tree ssa2);
- relation_kind query_relation (edge e, tree ssa1, tree ssa2);
- virtual relation_kind query_relation (basic_block, tree, tree)
- { return VREL_VARYING; }
+ relation_kind query (gimple *s, tree ssa1, tree ssa2);
+ relation_kind query (edge e, tree ssa1, tree ssa2);
+ virtual relation_kind query (basic_block, tree, tree) { return VREL_VARYING; }
virtual void dump (FILE *, basic_block) const { }
virtual void dump (FILE *) const { }
virtual const class pe_slice *partial_equiv_set (tree) { return NULL; }
void valid_equivs (bitmap b, const_bitmap equivs, basic_block bb);
// Query for a relation between two equivalency sets in a basic block.
- virtual relation_kind query_relation (basic_block, const_bitmap,
- const_bitmap) { return VREL_VARYING; }
+ virtual relation_kind query (basic_block, const_bitmap, const_bitmap)
+ { return VREL_VARYING; }
friend class path_oracle;
};
~equiv_oracle ();
const_bitmap equiv_set (tree ssa, basic_block bb) final override;
- void register_relation (basic_block bb, relation_kind k, tree ssa1,
- tree ssa2) override;
+ void record (basic_block bb, relation_kind k, tree ssa1, tree ssa2) override;
relation_kind partial_equiv (tree ssa1, tree ssa2, tree *base = NULL) const;
- relation_kind query_relation (basic_block, tree, tree) override;
- relation_kind query_relation (basic_block, const_bitmap, const_bitmap)
- override;
+ relation_kind query (basic_block, tree, tree) override;
+ relation_kind query (basic_block, const_bitmap, const_bitmap) override;
void dump (FILE *f, basic_block bb) const override;
void dump (FILE *f) const override;
dom_oracle ();
~dom_oracle ();
- void register_relation (basic_block bb, relation_kind k, tree op1, tree op2)
+ void record (basic_block bb, relation_kind k, tree op1, tree op2)
final override;
- relation_kind query_relation (basic_block bb, tree ssa1, tree ssa2)
+ relation_kind query (basic_block bb, tree ssa1, tree ssa2) final override;
+ relation_kind query (basic_block bb, const_bitmap b1, const_bitmap b2)
final override;
- relation_kind query_relation (basic_block bb, const_bitmap b1,
- const_bitmap b2) final override;
void dump (FILE *f, basic_block bb) const final override;
void dump (FILE *f) const final override;
path_oracle (relation_oracle *oracle = NULL);
~path_oracle ();
const_bitmap equiv_set (tree, basic_block) final override;
- void register_relation (basic_block, relation_kind, tree, tree) final override;
+ void record (basic_block, relation_kind, tree, tree) final override;
void killing_def (tree);
- relation_kind query_relation (basic_block, tree, tree) final override;
- relation_kind query_relation (basic_block, const_bitmap, const_bitmap)
- final override;
+ relation_kind query (basic_block, tree, tree) final override;
+ relation_kind query (basic_block, const_bitmap, const_bitmap) final override;
void reset_path (relation_oracle *oracle = NULL);
void set_root_oracle (relation_oracle *oracle) { m_root = oracle; }
void dump (FILE *, basic_block) const final override;