From patchwork Sun Apr 28 19:05:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1928681 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fevMtr9D; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VSGCm2ckxz23t4 for ; Mon, 29 Apr 2024 05:06:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A9A6384DD04 for ; Sun, 28 Apr 2024 19:06:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by sourceware.org (Postfix) with ESMTPS id 7ABA23858D39 for ; Sun, 28 Apr 2024 19:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7ABA23858D39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=localhost.redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7ABA23858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=207.211.30.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714331166; cv=none; b=B9qkSpCpBK/NcdMnR4mPx1nGBHfFnhNQVi76Va0M055MlnPdR1sHc01lZ1pBAoK3sR6Z9PFmh23qGqNqjo+CtlU5+UAN9Hl4RHcJ8akEMXbuVbetek8JLYL7NBESQMsUZOu9mH7rURMSIk3/BVc5fY1TXmZSt1b6LUxodbJhrvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714331166; c=relaxed/simple; bh=2VybkcZsWvaTMIonkOdIUeddNa0osdaXEK9j4jt7d9g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mMa0R9OqFsJkpM2oG/QpJx55RgNsdb1fakuizxavqCnzkusOYJoBFyU1H+Hgbt4OKCs9Mzz9a6Zin2PVE6Z9c6K5g/fOkn96U9X0d20GWYiOLePkovIcSUTD8Tizoxxs3qNB22SVi613c3VDxcltZ4+tPwFftmkBSFENJoqZG3s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714331164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9illnb6Ae01VtEjuXHQrnTdqpZ85/QTMDatmGmqoYxk=; b=fevMtr9DHGQ3E3bfXE0i/TcydbAdUTRRe7+go0LFN3bfa6lG39CXLB/pyGUxr7Lax0iqik No1AwUvrdpjDkXCG1N3/isGqg+tldeLeRIV+B2wuao9MoKyR6e0mgRrRkQMKNyYEkZ4BzW ZToeSvWHkYETmplwHP0dcQ0cL0f/jGA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-mDXPwxWmOWeUMZQAfVYYUQ-1; Sun, 28 Apr 2024 15:06:02 -0400 X-MC-Unique: mDXPwxWmOWeUMZQAfVYYUQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2713B1C09A42 for ; Sun, 28 Apr 2024 19:06:02 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8B5D1121312; Sun, 28 Apr 2024 19:06:01 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.2/8.17.1) with ESMTPS id 43SJ604d1209660 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 28 Apr 2024 21:06:00 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.2/8.17.2/Submit) id 43SJ60ZK1209659; Sun, 28 Apr 2024 21:06:00 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED 06/16] Remove GTY support for vrange and derived classes. Date: Sun, 28 Apr 2024 21:05:44 +0200 Message-ID: <20240428190557.1209586-7-aldyh@redhat.com> In-Reply-To: <20240428190557.1209586-1-aldyh@redhat.com> References: <20240428190557.1209586-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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. --- 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 (*x)) - return gt_ggc_mx ((irange *) x); - if (is_a (*x)) - return gt_ggc_mx ((frange *) x); - gcc_unreachable (); -} - -void -gt_pch_nx (vrange *x) -{ - if (is_a (*x)) - return gt_pch_nx ((irange *) x); - if (is_a (*x)) - return gt_pch_nx ((frange *) x); - gcc_unreachable (); -} - -void -gt_pch_nx (vrange *x, gt_pointer_operator op, void *cookie) -{ - if (is_a (*x)) - gt_pch_nx ((irange *) x, op, cookie); - else if (is_a (*x)) - gt_pch_nx ((frange *) x, op, cookie); - else - gcc_unreachable (); -} - #define DEFINE_INT_RANGE_INSTANCE(N) \ template int_range::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 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 -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 -inline void -gt_ggc_mx (int_range *x) -{ - gt_ggc_mx ((irange *) x); -} - -template -inline void -gt_pch_nx (int_range *x) -{ - gt_pch_nx ((irange *) x); -} - -template -inline void -gt_pch_nx (int_range *x, gt_pointer_operator op, void *cookie) -{ - gt_pch_nx ((irange *) x, op, cookie); -} - // Constructors for irange inline