bool get_global_range (vrange &r, tree name) const;
bool get_global_range (vrange &r, tree name, bool ¤t_p);
void set_global_range (tree name, const vrange &r, bool changed = true);
+ void update_consumers (tree name);
range_query &const_query () { return m_globals; }
void propagate_updated_value (tree name, basic_block bb);
return m_query->relation ().query (m_stmt, op1, op2);
}
-// Instantiate a stmt based fur_source with a GORI object.
+// Instantiate a stmt based fur_source with a GORI object and a ranger cache.
-
-fur_depend::fur_depend (gimple *s, range_query *q)
- : fur_stmt (s, q)
+fur_depend::fur_depend (gimple *s, range_query *q, ranger_cache *c)
+ : fur_stmt (s, q), m_cache (c)
{
m_depend_p = true;
}
fur_depend::register_relation (gimple *s, relation_kind k, tree op1, tree op2)
{
m_query->relation ().record (s, k, op1, op2);
+ // This new relation could cause different calculations, so mark the operands
+ // with a new timestamp, forcing recalculations.
+ if (m_cache)
+ {
+ m_cache->update_consumers (op1);
+ m_cache->update_consumers (op2);
+ }
}
// Register a relation on an edge if there is an oracle.
fur_depend::register_relation (edge e, relation_kind k, tree op1, tree op2)
{
m_query->relation ().record (e, k, op1, op2);
+ // This new relation could cause different calculations, so mark the operands
+ // with a new timestamp, forcing recalculations.
+ if (m_cache)
+ {
+ m_cache->update_consumers (op1);
+ m_cache->update_consumers (op2);
+ }
}
// This version of fur_source will pick a range up from a list of ranges
class fur_depend : public fur_stmt
{
public:
- fur_depend (gimple *s, range_query *q = NULL);
+ fur_depend (gimple *s, range_query *q = NULL, class ranger_cache *c = NULL);
virtual void register_relation (gimple *stmt, relation_kind k, tree op1,
tree op2) override;
virtual void register_relation (edge e, relation_kind k, tree op1,
tree op2) override;
+private:
+ ranger_cache *m_cache;
};
gimple_ranger::fold_range_internal (vrange &r, gimple *s, tree name)
{
fold_using_range f;
- fur_depend src (s, this);
+ fur_depend src (s, this, &m_cache);
return f.fold_stmt (r, s, src, name);
}