]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove various deprecated methods in class irange.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 14 Mar 2022 08:57:48 +0000 (09:57 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Fri, 29 Apr 2022 08:44:18 +0000 (10:44 +0200)
This patch cleans up some irange methods in preparation for other
cleanups later in the cycle.

First, we prefer the reference overloads for union and intersect as
the pointer versions have been deprecated for a couple releases.

Also, I've renamed the legacy union/intersect whose only function was
to provide additional verbosity for VRP into
legacy_verbose_{union,intersect}.  This is a temporary rename to serve
as a visual reminder of which of the methods are bound for the chopping
block when the legacy code gets removed later this cycle.

Tested on x86-64 Linux.

gcc/ChangeLog:

* gimple-fold.cc (size_must_be_zero_p): Use reference
instead of pointer
* gimple-ssa-evrp-analyze.cc
(evrp_range_analyzer::record_ranges_from_incoming_edge): Rename
intersect to legacy_verbose_intersect.
* ipa-cp.cc (ipcp_vr_lattice::meet_with_1): Use reference instead
of pointer.
* tree-ssa-dom.cc (dom_jt_simplifier::simplify): Use value_range
instead of value_range_equiv.
* tree-vrp.cc (extract_range_from_plus_minus_expr): Use reference
instead of pointer.
(find_case_label_range): Same.
* value-range-equiv.cc (value_range_equiv::intersect): Rename to...
(value_range_equiv::legacy_verbose_intersect): ...this.
(value_range_equiv::union_): Rename to...
(value_range_equiv::legacy_verbose_union_): ...this.
* value-range-equiv.h (class value_range_equiv): Rename union and
intersect to legacy_verbose_{intersect,union}.
* value-range.cc (irange::union_): Rename to...
(irange::legacy_verbose_union_): ...this.
(irange::intersect): Rename to...
(irange::legacy_verbose_intersect): ...this.
* value-range.h (irange::union_): Rename union_ to
legacy_verbose_union.
(irange::intersect): Rename intersect to legacy_verbose_intersect.
* vr-values.cc (vr_values::update_value_range): Same.
(vr_values::extract_range_for_var_from_comparison_expr): Same.
(vr_values::extract_range_from_cond_expr): Rename union_ to
legacy_verbose_union.
(vr_values::extract_range_from_phi_node): Same.

gcc/gimple-fold.cc
gcc/gimple-ssa-evrp-analyze.cc
gcc/ipa-cp.cc
gcc/tree-ssa-dom.cc
gcc/tree-vrp.cc
gcc/value-range-equiv.cc
gcc/value-range-equiv.h
gcc/value-range.cc
gcc/value-range.h
gcc/vr-values.cc

index 863ee3d391222a73e4d655ea89be89990b3a26db..7baec119ba35cc95cca5e05e591bb390769dc403 100644 (file)
@@ -883,7 +883,7 @@ size_must_be_zero_p (tree size)
     get_global_range_query ()->range_of_expr (vr, size);
   if (vr.undefined_p ())
     vr.set_varying (TREE_TYPE (size));
-  vr.intersect (&valid_range);
+  vr.intersect (valid_range);
   return vr.zero_p ();
 }
 
index 5b6c9f8fe1bf3a06ff31c9a1f717eb72a9dd2096..fec6e87ba80d6f7dbf6d04ba848dd53d3e4d4574 100644 (file)
@@ -207,7 +207,7 @@ evrp_range_analyzer::record_ranges_from_incoming_edge (basic_block bb)
              const value_range_equiv *old_vr
                = get_value_range (vrs[i].first);
              value_range tem (*old_vr);
-             tem.intersect (vrs[i].second);
+             tem.legacy_verbose_intersect (vrs[i].second);
              if (tem.equal_p (*old_vr))
                {
                  free_value_range (vrs[i].second);
index dc3f0e94b1789a3e42d4b8a82e3a7d3e3fc7c58c..11f4a327b99fbc1de3f6634ea9a8149019894c29 100644 (file)
@@ -1018,7 +1018,7 @@ ipcp_vr_lattice::meet_with_1 (const value_range *other_vr)
     return set_to_bottom ();
 
   value_range save (m_vr);
-  m_vr.union_ (other_vr);
+  m_vr.union_ (*other_vr);
   return !m_vr.equal_p (save);
 }
 
index 21745bf31d3f48989206efa67bd0541621368737..4a0cf2ef54c8f5b855237feb821b1802c72e4041 100644 (file)
@@ -694,7 +694,7 @@ dom_jt_simplifier::simplify (gimple *stmt, gimple *within_stmt,
       if (TREE_CODE (op) != SSA_NAME)
        return NULL_TREE;
 
-      const value_range_equiv *vr = m_vr_values->get_value_range (op);
+      const value_range *vr = m_vr_values->get_value_range (op);
       return find_case_label_range (switch_stmt, vr);
     }
   if (gassign *assign_stmt = dyn_cast <gassign *> (stmt))
index ab6aa11c0440172adefc052e02f68dcb1d13f353..0cbd9d369ca7ee35f005c9f8c15fa4b5c6ecce71 100644 (file)
@@ -768,7 +768,7 @@ extract_range_from_plus_minus_expr (value_range *vr,
          value_range vrres;
          extract_range_from_plus_minus_expr (&vrres, code, expr_type,
                                              &vrtem1, vr1_);
-         vr->union_ (&vrres);
+         vr->union_ (vrres);
        }
       return;
     }
@@ -782,7 +782,7 @@ extract_range_from_plus_minus_expr (value_range *vr,
          value_range vrres;
          extract_range_from_plus_minus_expr (&vrres, code, expr_type,
                                              vr0_, &vrtem1);
-         vr->union_ (&vrres);
+         vr->union_ (vrres);
        }
       return;
     }
@@ -2470,7 +2470,7 @@ find_case_label_range (gswitch *switch_stmt, const irange *range_of_op)
       int_range_max label_range (CASE_LOW (label), case_high);
       if (!types_compatible_p (label_range.type (), range_of_op->type ()))
        range_cast (label_range, range_of_op->type ());
-      label_range.intersect (range_of_op);
+      label_range.intersect (*range_of_op);
       if (label_range == *range_of_op)
        return label;
     }
@@ -2494,7 +2494,7 @@ find_case_label_range (gswitch *switch_stmt, const irange *range_of_op)
       int_range_max label_range (CASE_LOW (min_label), case_high);
       if (!types_compatible_p (label_range.type (), range_of_op->type ()))
        range_cast (label_range, range_of_op->type ());
-      label_range.intersect (range_of_op);
+      label_range.intersect (*range_of_op);
       if (label_range.undefined_p ())
        return gimple_switch_label (switch_stmt, 0);
     }
index 731fa53941d7736ffc5bd97668052f140e6bbf3d..77c6f5ca99d73cf197f16045e611815f71367e85 100644 (file)
@@ -188,7 +188,7 @@ value_range_equiv::equiv_add (const_tree var,
 }
 
 void
-value_range_equiv::intersect (const value_range_equiv *other)
+value_range_equiv::legacy_verbose_intersect (const value_range_equiv *other)
 {
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
@@ -238,7 +238,7 @@ value_range_equiv::intersect (const value_range_equiv *other)
 }
 
 void
-value_range_equiv::union_ (const value_range_equiv *other)
+value_range_equiv::legacy_verbose_union_ (const value_range_equiv *other)
 {
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
index 11b806c9141cf4ec7a42a8c97b19fdb57c116c3e..0aa1069cb6151ff3755829b57d3cb657a674dcf0 100644 (file)
@@ -48,8 +48,8 @@ class GTY((user)) value_range_equiv : public value_range
 
   bool operator== (const value_range_equiv &) const /* = delete */;
   bool operator!= (const value_range_equiv &) const /* = delete */;
-  void intersect (const value_range_equiv *);
-  void union_ (const value_range_equiv *);
+  void legacy_verbose_intersect (const value_range_equiv *);
+  void legacy_verbose_union_ (const value_range_equiv *);
   bool equal_p (const value_range_equiv &, bool ignore_equivs) const;
 
   /* Types of value ranges.  */
index 000bbcf8917e9c4306df83e1378a1bdf28086b8d..94301b32c377d9e483b28f2bce77ceb0ca21cd9a 100644 (file)
@@ -1442,7 +1442,7 @@ irange::legacy_union (irange *vr0, const irange *vr1)
    may not be the smallest possible such range.  */
 
 void
-irange::union_ (const irange *other)
+irange::legacy_verbose_union_ (const irange *other)
 {
   if (legacy_mode_p ())
     {
@@ -1482,7 +1482,7 @@ irange::union_ (const irange *other)
 }
 
 void
-irange::intersect (const irange *other)
+irange::legacy_verbose_intersect (const irange *other)
 {
   if (legacy_mode_p ())
     {
index b64e02426cab20ec31fe1b03eb5c1047828b8aaa..90a395f4d73a1d32fb55889e9d52133eaa96481b 100644 (file)
@@ -96,8 +96,8 @@ public:
   bool may_contain_p (tree) const;             // DEPRECATED
   void set (tree);                             // DEPRECATED
   bool equal_p (const irange &) const;         // DEPRECATED
-  void union_ (const class irange *);          // DEPRECATED
-  void intersect (const irange *);             // DEPRECATED
+  void legacy_verbose_union_ (const class irange *);   // DEPRECATED
+  void legacy_verbose_intersect (const irange *);      // DEPRECATED
 
 protected:
   irange (tree *, unsigned);
@@ -549,7 +549,7 @@ irange::union_ (const irange &r)
 {
   dump_flags_t m_flags = dump_flags;
   dump_flags &= ~TDF_DETAILS;
-  irange::union_ (&r);
+  irange::legacy_verbose_union_ (&r);
   dump_flags = m_flags;
 }
 
@@ -558,7 +558,7 @@ irange::intersect (const irange &r)
 {
   dump_flags_t m_flags = dump_flags;
   dump_flags &= ~TDF_DETAILS;
-  irange::intersect (&r);
+  irange::legacy_verbose_intersect (&r);
   dump_flags = m_flags;
 }
 
index 122586fbcc819a95d5b6f5c6e00c0531c71c703e..301996d213474c7d42a78512614a4f87707a5832 100644 (file)
@@ -266,7 +266,7 @@ vr_values::update_value_range (const_tree var, value_range_equiv *new_vr)
       value_range_equiv nr;
       get_global_range_query ()->range_of_expr (nr, const_cast <tree> (var));
       if (!nr.undefined_p ())
-       new_vr->intersect (&nr);
+       new_vr->legacy_verbose_intersect (&nr);
     }
 
   /* Update the value range, if necessary.  If we cannot allocate a lattice
@@ -750,7 +750,7 @@ vr_values::extract_range_for_var_from_comparison_expr (tree var,
     gcc_unreachable ();
 
   /* Finally intersect the new range with what we already know about var.  */
-  vr_p->intersect (get_value_range (var));
+  vr_p->legacy_verbose_intersect (get_value_range (var));
 }
 
 /* Extract value range information from an ASSERT_EXPR EXPR and store
@@ -1014,7 +1014,7 @@ vr_values::extract_range_from_cond_expr (value_range_equiv *vr, gassign *stmt)
 
   /* The resulting value range is the union of the operand ranges */
   vr->deep_copy (vr0);
-  vr->union_ (vr1);
+  vr->legacy_verbose_union_ (vr1);
 }
 
 
@@ -2300,10 +2300,10 @@ simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops
             for previously LE_ or LT_EXPR and GT_EXPR otherwise, but
             the comments next to the enclosing if suggest it's not
             generally profitable to do so.  */
-         vro.intersect (vr0);
+         vro.legacy_verbose_intersect (vr0);
          if (vro.undefined_p ())
            return boolean_false_node;
-         vri.intersect (vr0);
+         vri.legacy_verbose_intersect (vr0);
          if (vri.undefined_p ())
            return boolean_true_node;
        }
@@ -2803,7 +2803,7 @@ vr_values::extract_range_from_phi_node (gphi *phi,
          if (first)
            vr_result->deep_copy (vr_arg);
          else
-           vr_result->union_ (vr_arg);
+           vr_result->legacy_verbose_union_ (vr_arg);
          first = false;
 
          if (vr_result->varying_p ())