From patchwork Sat May 4 08:30:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1931232 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=LgVCQq/z; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4VWgrJ1frPz1xnS for ; Sat, 4 May 2024 18:31:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D0FE386F435 for ; Sat, 4 May 2024 08:31:40 +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 [205.139.111.44]) by sourceware.org (Postfix) with ESMTPS id 2B95738449C7 for ; Sat, 4 May 2024 08:31:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B95738449C7 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 2B95738449C7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.139.111.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714811465; cv=none; b=B3CMOm4bdq1QUIqEtBa4N8X3ezFsTliyfPzh3G25d2syFZiJmXx0dMWx9yXKhBVkdPeie4qfVYa2H0f29WMirthvObCjoUjk/kCtFb4t+a4PBuxq8KzSZzvAAuZWbseETwWvOihoc7oC/eOpCwFcyh6Z1KIQ9viYOy+MrWpOmgA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714811465; c=relaxed/simple; bh=TZAV3kIHBw5U/ZS9hbud0h8gmguugcko72yTYBOVJi8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kwU4XoXscB2D4Ts7jEV2jZDn8rL3aGGDifBR0zD6BxXJaifv1st2FR/+WHV6P/jfMktl59XKA+Gg3eaa7KSnXuNfKgz0bVKAX2qMswQBQC6aCEE2rc+qjbSSknFdBwVn1J2uae+eXWWgZ3VNc8dt6pnKZXDnu4lmvRkLPmdqvxI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714811462; 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=d2qDqecG5usnUmcmqNyM1/86hVhrF6SuCu4hXRSGD3c=; b=LgVCQq/zFZ98K7HtTqyc6vB5Axpiy/hCjt2U++yoVdyA04vosFecbFHU4H9ABQiZScRB3j GOJen9rMXDDF3FIkPigKwATVf7GKEQxu+gmoKFCDfA0vgdVTAn6Ee4/++9F2ytBUZN7Yfg rGwL2eGROl3Ag2e5V+OVcQufXWFWUTM= 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-580-8-nKtlcBNoiDfkd6XNz4FA-1; Sat, 04 May 2024 04:31:00 -0400 X-MC-Unique: 8-nKtlcBNoiDfkd6XNz4FA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 A799E3C000BE for ; Sat, 4 May 2024 08:31:00 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62A82200E66B; Sat, 4 May 2024 08:31:00 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.18.1/8.17.1) with ESMTPS id 4448Uxx2139796 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 4 May 2024 10:30:59 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.18.1/8.18.1/Submit) id 4448Uxbh139795; Sat, 4 May 2024 10:30:59 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED 03/23] Add streaming support for prange. Date: Sat, 4 May 2024 10:30:31 +0200 Message-ID: <20240504083056.139719-4-aldyh@redhat.com> In-Reply-To: <20240504083056.139719-1-aldyh@redhat.com> References: <20240504083056.139719-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 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 gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Add prange support. * data-streamer-out.cc (streamer_write_vrange): Same. --- gcc/data-streamer-in.cc | 12 ++++++++++++ gcc/data-streamer-out.cc | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/gcc/data-streamer-in.cc b/gcc/data-streamer-in.cc index 3a0d3c6ad0f..12cb10e42c0 100644 --- a/gcc/data-streamer-in.cc +++ b/gcc/data-streamer-in.cc @@ -268,6 +268,18 @@ streamer_read_value_range (class lto_input_block *ib, data_in *data_in, } return; } + if (is_a (vr)) + { + prange &r = as_a (vr); + wide_int lb = streamer_read_wide_int (ib); + wide_int ub = streamer_read_wide_int (ib); + r.set (type, lb, ub); + wide_int value = streamer_read_wide_int (ib); + wide_int mask = streamer_read_wide_int (ib); + irange_bitmask bm (value, mask); + r.update_bitmask (bm); + return; + } gcc_unreachable (); } diff --git a/gcc/data-streamer-out.cc b/gcc/data-streamer-out.cc index 07cc6bd2018..c237e30f704 100644 --- a/gcc/data-streamer-out.cc +++ b/gcc/data-streamer-out.cc @@ -450,6 +450,16 @@ streamer_write_vrange (struct output_block *ob, const vrange &v) } return; } + if (is_a (v)) + { + const prange &r = as_a (v); + streamer_write_wide_int (ob, r.lower_bound ()); + streamer_write_wide_int (ob, r.upper_bound ()); + irange_bitmask bm = r.get_bitmask (); + streamer_write_wide_int (ob, bm.value ()); + streamer_write_wide_int (ob, bm.mask ()); + return; + } gcc_unreachable (); }