From patchwork Wed Aug 31 12:38:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 866 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:ecc5:0:0:0:0:0 with SMTP id s5csp210515wro; Wed, 31 Aug 2022 05:39:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR7U0JS8ZysZiZpE2bSdxvXdbxuD/M8ICzctOb5T9WC97ma69zhfCDrbIQGX6y2EeByrl3Qg X-Received: by 2002:a17:906:5d08:b0:734:bf6a:6309 with SMTP id g8-20020a1709065d0800b00734bf6a6309mr19789093ejt.516.1661949575145; Wed, 31 Aug 2022 05:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661949575; cv=none; d=google.com; s=arc-20160816; b=bwyS3Iwwi907h/3vpS37VVvITW3e4ZCdo1msyd9zR9slPOHeu959Lsf8w8LKif7vZq lHsPNf+Ma4PRufuX/LK9kEaKacblTTYqyIZ7ILe6AOaGiidoaJ+lmw9by+lg7lhPWW2P 0LrgQ8LWTMvhjxRtqbwjwU/XbnQnObDX3HSGT3kvOBYd7GfW34fBTFrNEcsq7q5pvSKf f+YOTEztgfECmmU7BkiPZdmEYka6nMzrZBvOpQHZVQqfccZ1B5zXh41PBiRtc6WiAG4S M86KutC3JDiBX4AOHpvU4tuXgFa4aWXAn784hyf2kSz07ojMycv5VWLmkwQ9m9bSNLV5 ttSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=iW4+fgXuFX0ea2/ZTnF7ZIfR5/pcBw5fql1YFrBLqvE=; b=MDuMCXbliUAgUhnalTyHOKz4nTMlRRpN8+4JwmKgWmtBMq2Cz/R8W0bnLMxZe28xKK k3jz8jCbHHyEscaZLv9qaC7uZ47tXcjCKSTVjaN1SlgQI+FyOZ/5DUA5olrH8IM4fkrf clzaIlZjNMKvVqUT1RO61cokhjEP+rf+gHz8hoAFjB3Sw0UzVwldrR2OUgieqGD40JJW oFoVlG4gO8BEpNbtUXTlx+hvqs434/ypolDF2ziy1dH+Y4docFDQ/dPRSBcaxEoNK418 +C4YH0noOQZSun/i+POvwyJXMWXOToHAzmS9tfkC21JEUjJ0zxLZ2N/qZ174P4RHiQms IfBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xAHRjrz0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id eb13-20020a0564020d0d00b00447e593365esi12942605edb.150.2022.08.31.05.39.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 05:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xAHRjrz0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 298763851A95 for ; Wed, 31 Aug 2022 12:39:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 298763851A95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661949574; bh=iW4+fgXuFX0ea2/ZTnF7ZIfR5/pcBw5fql1YFrBLqvE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xAHRjrz0/GhonRkH8cn6cMf/ao5RX6IiEMQF0uURJkngLvhkz/nMSkKi5a7ove4vh Si2RWuCUgfwYwaesGi8PcmmoN+LuXnBajv3q3N+1Ic9/aBeQMjJ9RvaLD8El8PRvq1 KuDaXg+YoxrmKesFsYXETxIux9mwUZ4imc5I5FHM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id ED2F038582A7 for ; Wed, 31 Aug 2022 12:38:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED2F038582A7 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-281-QVDCtEQIPQ2P1PHWM_A-VA-1; Wed, 31 Aug 2022 08:38:48 -0400 X-MC-Unique: QVDCtEQIPQ2P1PHWM_A-VA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2892C3810792 for ; Wed, 31 Aug 2022 12:38:48 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C511BC15BB3; Wed, 31 Aug 2022 12:38:47 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 27VCcj7w2389600 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 31 Aug 2022 14:38:45 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 27VCcicu2389599; Wed, 31 Aug 2022 14:38:44 +0200 To: GCC patches Subject: [COMMITTED] Stream out endpoints for frange. Date: Wed, 31 Aug 2022 14:38:40 +0200 Message-Id: <20220831123840.2389555-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1742680437564879368?= X-GMAIL-MSGID: =?utf-8?q?1742680437564879368?= We only stream out the FP properties for global float ranges (currently only NAN). The following patch adds the endpoints as well. gcc/ChangeLog: * value-range-storage.cc (frange_storage_slot::set_frange): Save endpoints. (frange_storage_slot::get_frange): Restore endpoints. * value-range-storage.h (class frange_storage_slot): Add endpoint fields. --- gcc/value-range-storage.cc | 18 +++++++----------- gcc/value-range-storage.h | 8 +++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/gcc/value-range-storage.cc b/gcc/value-range-storage.cc index 494392737ac..b7a23fa9825 100644 --- a/gcc/value-range-storage.cc +++ b/gcc/value-range-storage.cc @@ -253,6 +253,8 @@ frange_storage_slot::set_frange (const frange &r) gcc_checking_assert (fits_p (r)); gcc_checking_assert (!r.undefined_p ()); + m_min = r.m_min; + m_max = r.m_max; m_props = r.m_props; } @@ -261,18 +263,12 @@ frange_storage_slot::get_frange (frange &r, tree type) const { gcc_checking_assert (r.supports_type_p (type)); - // FIXME: NANs get special treatment, because we need [NAN, NAN] in - // the range to properly represent it, not just the NAN flag in the - // property bits. This will go away when we stream out the - // endpoints. - if (m_props.get_nan ().yes_p ()) - { - r = frange_nan (type); - return; - } - - r.set_varying (type); + r.set_undefined (); + r.m_kind = VR_RANGE; r.m_props = m_props; + r.m_type = type; + r.m_min = m_min; + r.m_max = m_max; r.normalize_kind (); if (flag_checking) diff --git a/gcc/value-range-storage.h b/gcc/value-range-storage.h index 9cd6b9f7bec..f506789f3d1 100644 --- a/gcc/value-range-storage.h +++ b/gcc/value-range-storage.h @@ -113,9 +113,11 @@ class GTY (()) frange_storage_slot frange_storage_slot (const frange &r) { set_frange (r); } DISABLE_COPY_AND_ASSIGN (frange_storage_slot); - // We can get away with just storing the properties because the type - // can be gotten from the SSA, and UNDEFINED is unsupported, so it - // can only be a range. + // We can get away with just storing the properties and the + // endpoints because the type can be gotten from the SSA, and + // UNDEFINED is unsupported, so it can only be a VR_RANGE. + REAL_VALUE_TYPE m_min; + REAL_VALUE_TYPE m_max; frange_props m_props; };