diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2022-07-03 18:22:11 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2022-07-04 07:58:47 +0200 |
commit | bbe836bc7c557b3f4119e03d24cb61f23906cba9 (patch) | |
tree | ed5536607b0f5a76297de799c4a46d06fe10a464 /gcc | |
parent | 3731dd0bea8994c3d7b5a4879f89f3e7a0eb2cf4 (diff) | |
download | gcc-bbe836bc7c557b3f4119e03d24cb61f23906cba9.zip gcc-bbe836bc7c557b3f4119e03d24cb61f23906cba9.tar.gz gcc-bbe836bc7c557b3f4119e03d24cb61f23906cba9.tar.bz2 |
Remove some deprecated irange methods.
Tested on x86-64 Linux.
gcc/ChangeLog:
* ipa-cp.cc (ipcp_vr_lattice::meet_with_1): Use operator!=.
* ipa-prop.cc (struct ipa_vr_ggc_hash_traits): Same.
* tree-ssa-loop-unswitch.cc (struct unswitch_predicate): Use set
with two arguments.
(find_unswitching_predicates_for_bb): Same.
* tree-vrp.cc (range_fold_unary_symbolics_p): Same.
* value-range-equiv.cc (value_range_equiv::equal_p): Use operator==.
* value-range.cc (irange::equal_p): Rename to...
(irange::operator==): ...this.
* value-range.h (irange::set): Remove.
(irange::operator==): Remove.
(irange::set_zero): Use set with two arguments.
* vr-values.cc (vr_values::extract_range_from_binary_expr): Same.
(vr_values::extract_range_from_unary_expr): Same.
(check_for_binary_op_overflow): Same.
(bounds_of_var_in_loop): Same.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ipa-cp.cc | 2 | ||||
-rw-r--r-- | gcc/ipa-prop.cc | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-unswitch.cc | 4 | ||||
-rw-r--r-- | gcc/tree-vrp.cc | 3 | ||||
-rw-r--r-- | gcc/value-range-equiv.cc | 2 | ||||
-rw-r--r-- | gcc/value-range.cc | 2 | ||||
-rw-r--r-- | gcc/value-range.h | 16 | ||||
-rw-r--r-- | gcc/vr-values.cc | 20 |
8 files changed, 19 insertions, 32 deletions
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 18d2559..543a933 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -1020,7 +1020,7 @@ ipcp_vr_lattice::meet_with_1 (const value_range *other_vr) value_range save (m_vr); m_vr.union_ (*other_vr); - return !m_vr.equal_p (save); + return m_vr != save; } /* Return true if value range information in the lattice is yet unknown. */ diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index 7791563..fb8f973 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -126,7 +126,7 @@ struct ipa_vr_ggc_hash_traits : public ggc_cache_remove <value_range *> static bool equal (const value_range *a, const value_range *b) { - return (a->equal_p (*b) + return (*a == *b && types_compatible_p (a->type (), b->type ())); } static const bool empty_zero_p = true; diff --git a/gcc/tree-ssa-loop-unswitch.cc b/gcc/tree-ssa-loop-unswitch.cc index afae982..3a827f2 100644 --- a/gcc/tree-ssa-loop-unswitch.cc +++ b/gcc/tree-ssa-loop-unswitch.cc @@ -139,7 +139,7 @@ struct unswitch_predicate auto range_op = range_op_handler (code, TREE_TYPE (lhs)); int_range<2> rhs_range (TREE_TYPE (rhs)); if (CONSTANT_CLASS_P (rhs)) - rhs_range.set (rhs); + rhs_range.set (rhs, rhs); if (!range_op.op1_range (true_range, TREE_TYPE (lhs), int_range<2> (boolean_true_node, boolean_true_node), rhs_range) @@ -535,7 +535,7 @@ find_unswitching_predicates_for_bb (basic_block bb, class loop *loop, else { cmp = fold_build2 (EQ_EXPR, boolean_type_node, idx, low); - lab_range.set (low); + lab_range.set (low, low); } /* Combine the expression with the existing one. */ diff --git a/gcc/tree-vrp.cc b/gcc/tree-vrp.cc index 2d15bb5..ed881be 100644 --- a/gcc/tree-vrp.cc +++ b/gcc/tree-vrp.cc @@ -1024,7 +1024,8 @@ range_fold_unary_symbolics_p (value_range *vr, { /* ~X is simply -1 - X. */ value_range minusone; - minusone.set (build_int_cst (vr0->type (), -1)); + tree t = build_int_cst (vr0->type (), -1); + minusone.set (t, t); range_fold_binary_expr (vr, MINUS_EXPR, expr_type, &minusone, vr0); return true; } diff --git a/gcc/value-range-equiv.cc b/gcc/value-range-equiv.cc index b0ae128..bd58e5a 100644 --- a/gcc/value-range-equiv.cc +++ b/gcc/value-range-equiv.cc @@ -162,7 +162,7 @@ bool value_range_equiv::equal_p (const value_range_equiv &other, bool ignore_equivs) const { - return (value_range::equal_p (other) + return (value_range::operator== (other) && (ignore_equivs || vr_bitmap_equal_p (m_equiv, other.m_equiv))); } diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 815cb78..574c510 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -688,7 +688,7 @@ irange::legacy_equal_p (const irange &other) const } bool -irange::equal_p (const irange &other) const +irange::operator== (const irange &other) const { if (legacy_mode_p ()) { diff --git a/gcc/value-range.h b/gcc/value-range.h index 8ee7793..fd67031 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -157,8 +157,6 @@ public: void normalize_symbolics (); // DEPRECATED void normalize_addresses (); // DEPRECATED bool may_contain_p (tree) const; // DEPRECATED - void set (tree); // DEPRECATED - bool equal_p (const irange &) const; // DEPRECATED bool legacy_verbose_union_ (const class irange *); // DEPRECATED bool legacy_verbose_intersect (const irange *); // DEPRECATED @@ -720,12 +718,6 @@ int_range<N>::operator= (const int_range &src) } inline void -irange::set (tree val) -{ - set (val, val); -} - -inline void irange::set_undefined () { m_kind = VR_UNDEFINED; @@ -765,12 +757,6 @@ irange::set_varying (tree type) m_base[0] = m_base[1] = error_mark_node; } -inline bool -irange::operator== (const irange &r) const -{ - return equal_p (r); -} - // Return the lower bound of a sub-range. PAIR is the sub-range in // question. @@ -846,7 +832,7 @@ irange::set_zero (tree type) { tree z = build_int_cst (type, 0); if (legacy_mode_p ()) - set (z); + set (z, z); else irange_set (z, z); } diff --git a/gcc/vr-values.cc b/gcc/vr-values.cc index 38f204e..6b9c630 100644 --- a/gcc/vr-values.cc +++ b/gcc/vr-values.cc @@ -831,14 +831,14 @@ vr_values::extract_range_from_binary_expr (value_range_equiv *vr, if (TREE_CODE (op0) == SSA_NAME) vr0 = *(get_value_range (op0)); else if (is_gimple_min_invariant (op0)) - vr0.set (op0); + vr0.set (op0, op0); else vr0.set_varying (TREE_TYPE (op0)); if (TREE_CODE (op1) == SSA_NAME) vr1 = *(get_value_range (op1)); else if (is_gimple_min_invariant (op1)) - vr1.set (op1); + vr1.set (op1, op1); else vr1.set_varying (TREE_TYPE (op1)); @@ -936,7 +936,7 @@ vr_values::extract_range_from_binary_expr (value_range_equiv *vr, /* Try with [OP0, OP0] and VR1. */ else - n_vr0.set (op0); + n_vr0.set (op0, op0); range_fold_binary_expr (vr, code, expr_type, &n_vr0, &vr1); } @@ -976,7 +976,7 @@ vr_values::extract_range_from_unary_expr (value_range_equiv *vr, if (TREE_CODE (op0) == SSA_NAME) vr0 = *(get_value_range (op0)); else if (is_gimple_min_invariant (op0)) - vr0.set (op0); + vr0.set (op0, op0); else vr0.set_varying (type); @@ -1064,14 +1064,14 @@ check_for_binary_op_overflow (range_query *query, if (TREE_CODE (op0) == SSA_NAME) vr0 = *query->get_value_range (op0, s); else if (TREE_CODE (op0) == INTEGER_CST) - vr0.set (op0); + vr0.set (op0, op0); else vr0.set_varying (TREE_TYPE (op0)); if (TREE_CODE (op1) == SSA_NAME) vr1 = *query->get_value_range (op1, s); else if (TREE_CODE (op1) == INTEGER_CST) - vr1.set (op1); + vr1.set (op1, op1); else vr1.set_varying (TREE_TYPE (op1)); @@ -1747,7 +1747,7 @@ bounds_of_var_in_loop (tree *min, tree *max, range_query *query, if (TREE_CODE (init) == SSA_NAME) query->range_of_expr (vr0, init, stmt); else if (is_gimple_min_invariant (init)) - vr0.set (init); + vr0.set (init, init); else vr0.set_varying (TREE_TYPE (init)); tree tem = wide_int_to_tree (TREE_TYPE (init), wtmp); @@ -1763,7 +1763,7 @@ bounds_of_var_in_loop (tree *min, tree *max, range_query *query, if (TREE_CODE (init) == SSA_NAME) query->range_of_expr (initvr, init, stmt); else if (is_gimple_min_invariant (init)) - initvr.set (init); + initvr.set (init, init); else return false; @@ -3291,14 +3291,14 @@ simplify_using_ranges::simplify_bit_ops_using_ranges if (TREE_CODE (op0) == SSA_NAME) vr0 = *(query->get_value_range (op0, stmt)); else if (is_gimple_min_invariant (op0)) - vr0.set (op0); + vr0.set (op0, op0); else return false; if (TREE_CODE (op1) == SSA_NAME) vr1 = *(query->get_value_range (op1, stmt)); else if (is_gimple_min_invariant (op1)) - vr1.set (op1); + vr1.set (op1, op1); else return false; |