]> gcc.gnu.org Git - gcc.git/commitdiff
Remove irange::constant_p.
authorAldy Hernandez <aldyh@redhat.com>
Mon, 21 Nov 2022 10:45:47 +0000 (11:45 +0100)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 26 Apr 2023 08:28:12 +0000 (10:28 +0200)
gcc/ChangeLog:

* value-range-pretty-print.cc (vrange_printer::visit): Remove
constant_p use.
* value-range.cc (irange::constant_p): Remove.
(irange::get_nonzero_bits_from_range): Remove constant_p use.
* value-range.h (class irange): Remove constant_p.
(irange::num_pairs): Remove constant_p use.

gcc/value-range-pretty-print.cc
gcc/value-range.cc
gcc/value-range.h

index d20e25624316fdd3bbd3ed1caae4df9925790980..a11c5a621f8d175ddd99d5b4759a894ade0145ac 100644 (file)
@@ -63,19 +63,6 @@ vrange_printer::visit (const irange &r) const
       pp_string (pp, "VARYING");
       return;
     }
-  // Handle legacy symbolics.
-  if (!r.constant_p ())
-    {
-      if (r.kind () == VR_ANTI_RANGE)
-       pp_character (pp, '~');
-      pp_character (pp, '[');
-      dump_generic_node (pp, r.min (), 0, TDF_NONE, false);
-      pp_string (pp, ", ");
-      dump_generic_node (pp, r.max (), 0, TDF_NONE, false);
-      pp_character (pp, ']');
-      print_irange_bitmasks (r);
-      return;
-    }
   for (unsigned i = 0; i < r.num_pairs (); ++i)
     {
       pp_character (pp, '[');
index ebadea8b91710bf850f4b3bc16635403aaf39538..58ae2c157db8e748a0b2f9a531652b7630c9aa9b 100644 (file)
@@ -1351,16 +1351,6 @@ irange::operator== (const irange &other) const
   return nz1 == nz2;
 }
 
-/* Return TRUE if this is a constant range.  */
-
-bool
-irange::constant_p () const
-{
-  return (m_num_ranges > 0
-         && TREE_CODE (min ()) == INTEGER_CST
-         && TREE_CODE (max ()) == INTEGER_CST);
-}
-
 /* If range is a singleton, place it in RESULT and return TRUE.
    Note: A singleton can be any gimple invariant, not just constants.
    So, [&x, &x] counts as a singleton.  */
@@ -2835,10 +2825,6 @@ irange::invert ()
 wide_int
 irange::get_nonzero_bits_from_range () const
 {
-  // For legacy symbolics.
-  if (!constant_p ())
-    return wi::shwi (-1, TYPE_PRECISION (type ()));
-
   wide_int min = lower_bound ();
   wide_int max = upper_bound ();
   wide_int xorv = min ^ max;
index 1012d007261e82cb601800d25ad2fc0199c5700a..2442f8eed7026bf335a0f1803eeb005ac3f57ffb 100644 (file)
@@ -169,7 +169,6 @@ public:
   // Deprecated legacy public methods.
   tree min () const;                           // DEPRECATED
   tree max () const;                           // DEPRECATED
-  bool constant_p () const;                    // DEPRECATED
   bool legacy_verbose_union_ (const class irange *);   // DEPRECATED
   bool legacy_verbose_intersect (const irange *);      // DEPRECATED
 
@@ -692,7 +691,12 @@ inline unsigned
 irange::num_pairs () const
 {
   if (m_kind == VR_ANTI_RANGE)
-    return constant_p () ? 2 : 1;
+    {
+      bool constant_p = (TREE_CODE (min ()) == INTEGER_CST
+                        && TREE_CODE (max ()) == INTEGER_CST);
+      gcc_checking_assert (constant_p);
+      return 2;
+    }
   else
     return m_num_ranges;
 }
This page took 0.06614 seconds and 5 git commands to generate.