diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-05-26 08:53:07 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-06-03 17:47:54 +0200 |
commit | 04affb328c6a7e29427287c5192da38864f0dbca (patch) | |
tree | 7fc6ce9c8a100f5e9ab6ae297e52d3ebbfcf93c6 /gcc/tree-vrp.c | |
parent | caa60c12715dd9b0cbb550a45e5878214a10a2fe (diff) | |
download | gcc-04affb328c6a7e29427287c5192da38864f0dbca.zip gcc-04affb328c6a7e29427287c5192da38864f0dbca.tar.gz gcc-04affb328c6a7e29427287c5192da38864f0dbca.tar.bz2 |
Replace uses of determine_value_range with range_of_expr.
The expression evaluator changes to the range_query API provide
everything determine_value_range does. This patch replaces all uses
with calls into the range_query API.
gcc/ChangeLog:
* calls.c (get_size_range): Use range_of_expr instead of
determine_value_range.
* tree-affine.c (expr_to_aff_combination): Same.
* tree-data-ref.c (split_constant_offset): Same.
* tree-vrp.c (determine_value_range_1): Remove.
(determine_value_range): Remove.
* tree-vrp.h (determine_value_range): Remove.
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 450926d..b9c0e65 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4606,59 +4606,3 @@ make_pass_vrp (gcc::context *ctxt) { return new pass_vrp (ctxt); } - - -/* Worker for determine_value_range. */ - -static void -determine_value_range_1 (value_range *vr, tree expr) -{ - if (BINARY_CLASS_P (expr)) - { - value_range vr0, vr1; - determine_value_range_1 (&vr0, TREE_OPERAND (expr, 0)); - determine_value_range_1 (&vr1, TREE_OPERAND (expr, 1)); - range_fold_binary_expr (vr, TREE_CODE (expr), TREE_TYPE (expr), - &vr0, &vr1); - } - else if (UNARY_CLASS_P (expr)) - { - value_range vr0; - determine_value_range_1 (&vr0, TREE_OPERAND (expr, 0)); - range_fold_unary_expr (vr, TREE_CODE (expr), TREE_TYPE (expr), - &vr0, TREE_TYPE (TREE_OPERAND (expr, 0))); - } - else if (TREE_CODE (expr) == INTEGER_CST) - vr->set (expr); - else - { - value_range r; - /* For SSA names try to extract range info computed by VRP. Otherwise - fall back to varying. */ - if (TREE_CODE (expr) == SSA_NAME - && INTEGRAL_TYPE_P (TREE_TYPE (expr)) - && get_range_query (cfun)->range_of_expr (r, expr) - && !r.undefined_p ()) - *vr = r; - else - vr->set_varying (TREE_TYPE (expr)); - } -} - -/* Compute a value-range for EXPR and set it in *MIN and *MAX. Return - the determined range type. */ - -value_range_kind -determine_value_range (tree expr, wide_int *min, wide_int *max) -{ - value_range vr; - determine_value_range_1 (&vr, expr); - if (!vr.varying_p () && vr.constant_p ()) - { - *min = wi::to_wide (vr.min ()); - *max = wi::to_wide (vr.max ()); - return vr.kind (); - } - - return VR_VARYING; -} |