aboutsummaryrefslogtreecommitdiff
path: root/gcc/value-query.h
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2021-06-17 10:19:31 -0400
committerAndrew MacLeod <amacleod@redhat.com>2021-06-22 08:11:44 -0400
commit3aaa69e5f30e1904d7ca2bb711b1cb0c62b6895f (patch)
tree1caa5a6f5da442c5a2f837f34ea20d3b41d85996 /gcc/value-query.h
parenta2ef8395fa970498985764514044e5fd00f7d5c0 (diff)
downloadgcc-3aaa69e5f30e1904d7ca2bb711b1cb0c62b6895f.zip
gcc-3aaa69e5f30e1904d7ca2bb711b1cb0c62b6895f.tar.gz
gcc-3aaa69e5f30e1904d7ca2bb711b1cb0c62b6895f.tar.bz2
Initial value-relation code.
This code provides a both an equivalence and relation oracle which can be accessed via a range_query object. This initial code drop includes the oracles and access them, but does not utilize them yet. * Makefile.in (OBJS): Add value-relation.o. * gimple-range.h: Adjust include files. * tree-data-ref.c: Adjust include file order. * value-query.cc (range_query::get_value_range): Default to no oracle. (range_query::query_relation): New. (range_query::query_relation): New. * value-query.h (class range_query): Adjust. * value-relation.cc: New. * value-relation.h: New.
Diffstat (limited to 'gcc/value-query.h')
-rw-r--r--gcc/value-query.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/value-query.h b/gcc/value-query.h
index 54af031..5161d23 100644
--- a/gcc/value-query.h
+++ b/gcc/value-query.h
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_QUERY_H
#define GCC_QUERY_H
+#include "value-relation.h"
+
// The value_query class is used by optimization passes that require
// valueizing SSA names in terms of a tree value, but have no neeed
// for ranges.
@@ -91,6 +93,14 @@ public:
virtual bool range_on_edge (irange &r, edge, tree expr);
virtual bool range_of_stmt (irange &r, gimple *, tree name = NULL);
+ // Query if there is any relation between SSA1 and SSA2.
+ relation_kind query_relation (gimple *s, tree ssa1, tree ssa2,
+ bool get_range = true);
+ relation_kind query_relation (edge e, tree ssa1, tree ssa2,
+ bool get_range = true);
+ // If present, Access relation oracle for more advanced uses.
+ inline relation_oracle *oracle () const { return m_oracle; }
+
// DEPRECATED: This method is used from vr-values. The plan is to
// rewrite all uses of it to the above API.
virtual const class value_range_equiv *get_value_range (const_tree,
@@ -102,6 +112,7 @@ protected:
void free_value_range_equiv (class value_range_equiv *);
bool get_tree_range (irange &r, tree expr, gimple *stmt);
bool get_arith_expr_range (irange &r, tree expr, gimple *stmt);
+ relation_oracle *m_oracle;
private:
class equiv_allocator *equiv_alloc;