]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove some deprecated irange methods.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 3 Jul 2022 16:22:11 +0000 (18:22 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 4 Jul 2022 05:58:47 +0000 (07:58 +0200)
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.

gcc/ipa-cp.cc
gcc/ipa-prop.cc
gcc/tree-ssa-loop-unswitch.cc
gcc/tree-vrp.cc
gcc/value-range-equiv.cc
gcc/value-range.cc
gcc/value-range.h
gcc/vr-values.cc

index 18d2559e5a307f2e692bc3f61ba3d73d7c7d9507..543a9334e2c1ffab4c8cb374f7de02e3bd979cd7 100644 (file)
@@ -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.  */
index 77915632fa88fe03248484314272cdc9f0f34cb5..fb8f97397dc40292a68a3a810f19b0c81850e616 100644 (file)
@@ -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;
index afae9825eda56e289aa5216cc85c1c26f54bb3eb..3a827f2f904533ebd73f0b79ff88f0fc08d0b8bc 100644 (file)
@@ -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.  */
index 2d15bb5a6505c5234ba21b7b3ff77dcb19bf4f70..ed881be7e5ff4d32cc35457117c917213199fc1b 100644 (file)
@@ -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;
        }
index b0ae1288a096292fc063ebe9198b7750a4578c73..bd58e5a90bc7fa41c5c03fda5efc696d961741cb 100644 (file)
@@ -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)));
 }
 
index 815cb783abc8231d195b9f17f9cf82f1e5d83e83..574c51002b5a1ea04d62b5b59ccfb778e433ed6a 100644 (file)
@@ -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 ())
     {
index 8ee7793baeb9bd0a242d8885ddcf0986b38a8545..fd6703138accf968a290ba14db29f1b082ef7936 100644 (file)
@@ -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
 
@@ -719,12 +717,6 @@ int_range<N>::operator= (const int_range &src)
   return *this;
 }
 
-inline void
-irange::set (tree val)
-{
-  set (val, val);
-}
-
 inline void
 irange::set_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);
 }
index 38f204e2f5d6d729627ffc68a8ff353980eb8cf1..6b9c630fed34ee1d87a5dd8b3839aaaaa61abc2c 100644 (file)
@@ -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;