From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 10CAE3858C52 for ; Fri, 23 Sep 2022 12:58:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10CAE3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663937918; 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; bh=KLYf6OtLsOfT6U+BLD5GUATc1EhGVpxF6LDqQDD6O3A=; b=E8UR3hmo1gyJOmJP4ZQ0/xDM5Q2iWR+yHle7Ha0aODesj6oOr0o2Ijp4Ub0VVjq1lqU3yr HQtaabMYUbfJjZtVeDjeOoIX2SlQuoUtU5TZJL/AwKVPA7X2o3PiTGIXW3nGhWb88c6Ggs KlMNWxTay9+B3RbZnDciFOA+heOImZ4= 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-315-mYO7yy66PjGZ2GsRkyKbzg-1; Fri, 23 Sep 2022 08:58:37 -0400 X-MC-Unique: mYO7yy66PjGZ2GsRkyKbzg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C53C41C09CAA for ; Fri, 23 Sep 2022 12:58:35 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.194.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D6DF18EB4; Fri, 23 Sep 2022 12:58:35 +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 28NCwW2I2715556 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 23 Sep 2022 14:58:32 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 28NCwWQZ2715555; Fri, 23 Sep 2022 14:58:32 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] frange: Make the setter taking trees a wrapper. Date: Fri, 23 Sep 2022 14:58:30 +0200 Message-Id: <20220923125830.2715538-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The frange setter does all its work in trees. This incurs a penalty for the real_value variants because they must wrap their arguments into a tree and pass it to the tree setter, which will then do the opposite. This is leftovers from the irange setter. Even though the we still need constructors taking trees so we can interact with the tree world, there's no sense penalizing the rest of the implementation. Tested on x86-64 Linux. gcc/ChangeLog: * value-range.cc (frange::set): Swap setters such that the one accepting REAL_VALUE_TYPE does all the work. --- gcc/value-range.cc | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 43905ba4901..9ca442478c9 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -290,7 +290,9 @@ frange::flush_denormals_to_zero () // Setter for franges. void -frange::set (tree min, tree max, value_range_kind kind) +frange::set (tree type, + const REAL_VALUE_TYPE &min, const REAL_VALUE_TYPE &max, + value_range_kind kind) { switch (kind) { @@ -299,7 +301,7 @@ frange::set (tree min, tree max, value_range_kind kind) return; case VR_VARYING: case VR_ANTI_RANGE: - set_varying (TREE_TYPE (min)); + set_varying (type); return; case VR_RANGE: break; @@ -308,14 +310,12 @@ frange::set (tree min, tree max, value_range_kind kind) } // Handle NANs. - if (real_isnan (TREE_REAL_CST_PTR (min)) || real_isnan (TREE_REAL_CST_PTR (max))) + if (real_isnan (&min) || real_isnan (&max)) { - gcc_checking_assert (real_identical (TREE_REAL_CST_PTR (min), - TREE_REAL_CST_PTR (max))); - tree type = TREE_TYPE (min); + gcc_checking_assert (real_identical (&min, &max)); if (HONOR_NANS (type)) { - bool sign = real_isneg (TREE_REAL_CST_PTR (min)); + bool sign = real_isneg (&min); set_nan (type, sign); } else @@ -324,9 +324,9 @@ frange::set (tree min, tree max, value_range_kind kind) } m_kind = kind; - m_type = TREE_TYPE (min); - m_min = *TREE_REAL_CST_PTR (min); - m_max = *TREE_REAL_CST_PTR (max); + m_type = type; + m_min = min; + m_max = max; if (HONOR_NANS (m_type)) { m_pos_nan = true; @@ -351,7 +351,7 @@ frange::set (tree min, tree max, value_range_kind kind) } // Check for swapped ranges. - gcc_checking_assert (tree_compare (LE_EXPR, min, max)); + gcc_checking_assert (real_compare (LE_EXPR, &min, &max)); normalize_kind (); @@ -361,14 +361,11 @@ frange::set (tree min, tree max, value_range_kind kind) verify_range (); } -// Setter for frange from REAL_VALUE_TYPE endpoints. - void -frange::set (tree type, - const REAL_VALUE_TYPE &min, const REAL_VALUE_TYPE &max, - value_range_kind kind) +frange::set (tree min, tree max, value_range_kind kind) { - set (build_real (type, min), build_real (type, max), kind); + set (TREE_TYPE (min), + *TREE_REAL_CST_PTR (min), *TREE_REAL_CST_PTR (max), kind); } // Normalize range to VARYING or UNDEFINED, or vice versa. Return -- 2.37.1