aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssanames.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2021-05-26 08:25:36 +0200
committerAldy Hernandez <aldyh@redhat.com>2021-05-27 10:37:49 +0200
commit13dbaefefbab04d5137e718262d4b81cb9035784 (patch)
tree10bd8974fbd0de0e2d24809141685d726fa2aae1 /gcc/tree-ssanames.c
parent95bef94c6c6c6cb7bf640068aea77c209bca7c65 (diff)
downloadgcc-13dbaefefbab04d5137e718262d4b81cb9035784.zip
gcc-13dbaefefbab04d5137e718262d4b81cb9035784.tar.gz
gcc-13dbaefefbab04d5137e718262d4b81cb9035784.tar.bz2
Move global range code to value-query.cc.
This patch moves all the global range code from gimple-range.cc into value-query.cc. It also moves get_range_info and get_ptr_nonnull from tree-ssanames.c into their only uses, and removes external access to them. gcc/ChangeLog: * gimple-range.cc (get_range_global): Move to value-query.cc. (gimple_range_global): Same. (get_global_range_query): Same. (global_range_query::range_of_expr): Same. * gimple-range.h (class global_range_query): Move to value-query.h. (gimple_range_global): Same. * tree-ssanames.c (get_range_info): Move to value-query.cc. (get_ptr_nonnull): Same. * tree-ssanames.h (get_range_info): Remove. (get_ptr_nonnull): Remove. * value-query.cc (get_ssa_name_range_info): Move from tree-ssanames.c. (get_ssa_name_ptr_info_nonnull): Same. (get_range_global): Move from gimple-range.cc. (gimple_range_global): Same. (get_global_range_query): Same. (global_range_query::range_of_expr): Same. * value-query.h (class global_range_query): Move from gimple-range.h. (gimple_range_global): Same.
Diffstat (limited to 'gcc/tree-ssanames.c')
-rw-r--r--gcc/tree-ssanames.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 5329c0a..2165ad7 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -423,31 +423,6 @@ set_range_info (tree name, const value_range &vr)
set_range_info (name, vr.kind (), min, max);
}
-/* Gets range information corresponding to ssa_name NAME and stores it
- in a value_range VR. Returns the value_range_kind. */
-
-enum value_range_kind
-get_range_info (const_tree name, irange &vr)
-{
- tree type = TREE_TYPE (name);
- gcc_checking_assert (!POINTER_TYPE_P (type));
- gcc_checking_assert (TREE_CODE (name) == SSA_NAME);
-
- range_info_def *ri = SSA_NAME_RANGE_INFO (name);
-
- /* Return VR_VARYING for SSA_NAMEs with NULL RANGE_INFO or SSA_NAMEs
- with integral types width > 2 * HOST_BITS_PER_WIDE_INT precision. */
- if (!ri || (GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (TREE_TYPE (name)))
- > 2 * HOST_BITS_PER_WIDE_INT))
- vr.set_varying (type);
- else
- vr.set (wide_int_to_tree (type, ri->get_min ()),
- wide_int_to_tree (type, ri->get_max ()),
- SSA_NAME_RANGE_TYPE (name));
-
- return vr.kind ();
-}
-
/* Set nonnull attribute to pointer NAME. */
void
@@ -458,25 +433,6 @@ set_ptr_nonnull (tree name)
pi->pt.null = 0;
}
-/* Return nonnull attribute of pointer NAME. */
-bool
-get_ptr_nonnull (const_tree name)
-{
- gcc_assert (POINTER_TYPE_P (TREE_TYPE (name)));
- struct ptr_info_def *pi = SSA_NAME_PTR_INFO (name);
- if (pi == NULL)
- return false;
- /* TODO Now pt->null is conservatively set to true in PTA
- analysis. vrp is the only pass (including ipa-vrp)
- that clears pt.null via set_ptr_nonull when it knows
- for sure. PTA will preserves the pt.null value set by VRP.
-
- When PTA analysis is improved, pt.anything, pt.nonlocal
- and pt.escaped may also has to be considered before
- deciding that pointer cannot point to NULL. */
- return !pi->pt.null;
-}
-
/* Change non-zero bits bitmask of NAME. */
void