public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-31] Remove GTY support for vrange and derived classes.
@ 2024-04-28 19:04 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2024-04-28 19:04 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:eeef1f69c5e77ecf13fdcf44df5bcf592a9993e6
commit r15-31-geeef1f69c5e77ecf13fdcf44df5bcf592a9993e6
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Wed Feb 21 09:34:29 2024 +0100
Remove GTY support for vrange and derived classes.
Now that we have a vrange storage class to save ranges in long-term
memory, there is no need for GTY markers for any of the vrange
classes, since they should never live in GC.
gcc/ChangeLog:
* value-range-storage.h: Remove friends.
* value-range.cc (gt_ggc_mx): Remove.
(gt_pch_nx): Remove.
* value-range.h (class vrange): Remove GTY markers.
(class irange): Same.
(class int_range): Same.
(class frange): Same.
(gt_ggc_mx): Remove.
(gt_pch_nx): Remove.
Diff:
---
gcc/value-range-storage.h | 4 ---
gcc/value-range.cc | 73 -----------------------------------------------
gcc/value-range.h | 46 +++--------------------------
3 files changed, 4 insertions(+), 119 deletions(-)
diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h
index d94c520aa73..5756de7e32d 100644
--- a/gcc/value-range-storage.h
+++ b/gcc/value-range-storage.h
@@ -75,10 +75,6 @@ private:
static size_t size (const irange &r);
const unsigned short *lengths_address () const;
unsigned short *write_lengths_address ();
- friend void gt_ggc_mx_irange_storage (void *);
- friend void gt_pch_p_14irange_storage (void *, void *,
- gt_pointer_operator, void *);
- friend void gt_pch_nx_irange_storage (void *);
// The shared precision of each number.
unsigned short m_precision;
diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index 926f7b707ea..b901c864a7b 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -2165,79 +2165,6 @@ vrp_operand_equal_p (const_tree val1, const_tree val2)
return true;
}
-void
-gt_ggc_mx (irange *x)
-{
- if (!x->undefined_p ())
- gt_ggc_mx (x->m_type);
-}
-
-void
-gt_pch_nx (irange *x)
-{
- if (!x->undefined_p ())
- gt_pch_nx (x->m_type);
-}
-
-void
-gt_pch_nx (irange *x, gt_pointer_operator op, void *cookie)
-{
- for (unsigned i = 0; i < x->m_num_ranges; ++i)
- {
- op (&x->m_base[i * 2], NULL, cookie);
- op (&x->m_base[i * 2 + 1], NULL, cookie);
- }
-}
-
-void
-gt_ggc_mx (frange *x)
-{
- gt_ggc_mx (x->m_type);
-}
-
-void
-gt_pch_nx (frange *x)
-{
- gt_pch_nx (x->m_type);
-}
-
-void
-gt_pch_nx (frange *x, gt_pointer_operator op, void *cookie)
-{
- op (&x->m_type, NULL, cookie);
-}
-
-void
-gt_ggc_mx (vrange *x)
-{
- if (is_a <irange> (*x))
- return gt_ggc_mx ((irange *) x);
- if (is_a <frange> (*x))
- return gt_ggc_mx ((frange *) x);
- gcc_unreachable ();
-}
-
-void
-gt_pch_nx (vrange *x)
-{
- if (is_a <irange> (*x))
- return gt_pch_nx ((irange *) x);
- if (is_a <frange> (*x))
- return gt_pch_nx ((frange *) x);
- gcc_unreachable ();
-}
-
-void
-gt_pch_nx (vrange *x, gt_pointer_operator op, void *cookie)
-{
- if (is_a <irange> (*x))
- gt_pch_nx ((irange *) x, op, cookie);
- else if (is_a <frange> (*x))
- gt_pch_nx ((frange *) x, op, cookie);
- else
- gcc_unreachable ();
-}
-
#define DEFINE_INT_RANGE_INSTANCE(N) \
template int_range<N>::int_range(tree_node *, \
const wide_int &, \
diff --git a/gcc/value-range.h b/gcc/value-range.h
index 991ffeafcb8..2650ded6d10 100644
--- a/gcc/value-range.h
+++ b/gcc/value-range.h
@@ -72,7 +72,7 @@ enum value_range_discriminator
// if (f.supports_type_p (type)) ...
// }
-class GTY((user)) vrange
+class vrange
{
template <typename T> friend bool is_a (vrange &);
friend class Value_Range;
@@ -279,7 +279,7 @@ irange_bitmask::intersect (const irange_bitmask &orig_src)
// An integer range without any storage.
-class GTY((user)) irange : public vrange
+class irange : public vrange
{
friend value_range_kind get_legacy_range (const irange &, tree &, tree &);
friend class irange_storage;
@@ -350,10 +350,6 @@ protected:
// Hard limit on max ranges allowed.
static const int HARD_MAX_RANGES = 255;
private:
- friend void gt_ggc_mx (irange *);
- friend void gt_pch_nx (irange *);
- friend void gt_pch_nx (irange *, gt_pointer_operator, void *);
-
bool varying_compatible_p () const;
bool intersect_bitmask (const irange &r);
bool union_bitmask (const irange &r);
@@ -379,7 +375,7 @@ protected:
// HARD_MAX_RANGES. This new storage is freed upon destruction.
template<unsigned N, bool RESIZABLE = false>
-class GTY((user)) int_range : public irange
+class int_range : public irange
{
public:
int_range ();
@@ -484,13 +480,10 @@ nan_state::neg_p () const
// The representation is a type with a couple of endpoints, unioned
// with the set of { -NAN, +Nan }.
-class GTY((user)) frange : public vrange
+class frange : public vrange
{
friend class frange_storage;
friend class vrange_printer;
- friend void gt_ggc_mx (frange *);
- friend void gt_pch_nx (frange *);
- friend void gt_pch_nx (frange *, gt_pointer_operator, void *);
public:
frange ();
frange (const frange &);
@@ -991,37 +984,6 @@ range_includes_zero_p (const irange *vr)
return vr->contains_p (zero);
}
-extern void gt_ggc_mx (vrange *);
-extern void gt_pch_nx (vrange *);
-extern void gt_pch_nx (vrange *, gt_pointer_operator, void *);
-extern void gt_ggc_mx (irange *);
-extern void gt_pch_nx (irange *);
-extern void gt_pch_nx (irange *, gt_pointer_operator, void *);
-extern void gt_ggc_mx (frange *);
-extern void gt_pch_nx (frange *);
-extern void gt_pch_nx (frange *, gt_pointer_operator, void *);
-
-template<unsigned N>
-inline void
-gt_ggc_mx (int_range<N> *x)
-{
- gt_ggc_mx ((irange *) x);
-}
-
-template<unsigned N>
-inline void
-gt_pch_nx (int_range<N> *x)
-{
- gt_pch_nx ((irange *) x);
-}
-
-template<unsigned N>
-inline void
-gt_pch_nx (int_range<N> *x, gt_pointer_operator op, void *cookie)
-{
- gt_pch_nx ((irange *) x, op, cookie);
-}
-
// Constructors for irange
inline
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-28 19:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-28 19:04 [gcc r15-31] Remove GTY support for vrange and derived classes Aldy Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).