From patchwork Tue Sep 19 16:30:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1836785 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=cxSNNqD2; 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 4RqnHb1FL9z1ynX for ; Wed, 20 Sep 2023 02:31:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11A42385DC10 for ; Tue, 19 Sep 2023 16:31:53 +0000 (GMT) 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 50ACE3858418 for ; Tue, 19 Sep 2023 16:31:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 50ACE3858418 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=1695141059; 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=hhn1MyyG+3k8mn4BTHRK2SGAYkGVpUNHqjUsZFqkhwM=; b=cxSNNqD2IM1M7/bw4ZhrBOGetAuixIi8ZL81994GmzilrNq4oE0+4EyuOAbxYtZWof71+K yFFfI/ji+zRmfekTQv8qg/UMsiw0HOe7CiwaZ0zaMzoAfu3B+QVBQa1AnbfdIYIeqpsrNN 9d1arJ/JaTMCM/v8Ks4KVdxovobcqlk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-PBAcK6M8O0upS5vA25UPPg-1; Tue, 19 Sep 2023 12:30:58 -0400 X-MC-Unique: PBAcK6M8O0upS5vA25UPPg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E4138001EA for ; Tue, 19 Sep 2023 16:30:57 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.22.34.199]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B26B1C5BB; Tue, 19 Sep 2023 16:30:57 +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 38JGUuKQ865059 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 12:30:57 -0400 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 38JGUuc5865058; Tue, 19 Sep 2023 12:30:56 -0400 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] [frange] Remove redundant known_isnan() checks. Date: Tue, 19 Sep 2023 12:30:47 -0400 Message-ID: <20230919163052.865027-3-aldyh@redhat.com> In-Reply-To: <20230919163052.865027-1-aldyh@redhat.com> References: <20230919163052.865027-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 X-Spam-Status: No, score=-11.4 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_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 The known_isnan() method is a subset of maybe_isnan(). This patch removes redundant calls to known_isnan(). gcc/ChangeLog: * range-op-float.cc (operator_lt::op1_range): Remove known_isnan check. (operator_lt::op2_range): Same. (operator_le::op1_range): Same. (operator_le::op2_range): Same. (operator_gt::op1_range): Same. (operator_gt::op2_range): Same. (operator_ge::op1_range): Same. (operator_ge::op2_range): Same. (foperator_unordered_lt::op1_range): Same. (foperator_unordered_lt::op2_range): Same. (foperator_unordered_le::op1_range): Same. (foperator_unordered_le::op2_range): Same. (foperator_unordered_gt::op1_range): Same. (foperator_unordered_gt::op2_range): Same. (foperator_unordered_ge::op1_range): Same. (foperator_unordered_ge::op2_range): Same. --- gcc/range-op-float.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 91d3096fdac..5eb1d9c06e3 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -981,7 +981,7 @@ operator_lt::op1_range (frange &r, case BRS_FALSE: // On the FALSE side of x < NAN, we know nothing about x. - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else build_ge (r, type, op2); @@ -1018,7 +1018,7 @@ operator_lt::op2_range (frange &r, case BRS_FALSE: // On the FALSE side of NAN < x, we know nothing about x. - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else build_le (r, type, op1); @@ -1091,7 +1091,7 @@ operator_le::op1_range (frange &r, case BRS_FALSE: // On the FALSE side of x <= NAN, we know nothing about x. - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else build_gt (r, type, op2); @@ -1124,7 +1124,7 @@ operator_le::op2_range (frange &r, case BRS_FALSE: // On the FALSE side of NAN <= x, we know nothing about x. - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -1210,7 +1210,7 @@ operator_gt::op1_range (frange &r, case BRS_FALSE: // On the FALSE side of x > NAN, we know nothing about x. - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -1249,7 +1249,7 @@ operator_gt::op2_range (frange &r, case BRS_FALSE: // On The FALSE side of NAN > x, we know nothing about x. - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -1323,7 +1323,7 @@ operator_ge::op1_range (frange &r, case BRS_FALSE: // On the FALSE side of x >= NAN, we know nothing about x. - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -1357,7 +1357,7 @@ operator_ge::op2_range (frange &r, tree type, case BRS_FALSE: // On the FALSE side of NAN >= x, we know nothing about x. - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -1720,7 +1720,7 @@ foperator_unordered_lt::op1_range (frange &r, tree type, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -1754,7 +1754,7 @@ foperator_unordered_lt::op2_range (frange &r, tree type, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -1832,7 +1832,7 @@ foperator_unordered_le::op1_range (frange &r, tree type, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -1865,7 +1865,7 @@ foperator_unordered_le::op2_range (frange &r, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -1945,7 +1945,7 @@ foperator_unordered_gt::op1_range (frange &r, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -1980,7 +1980,7 @@ foperator_unordered_gt::op2_range (frange &r, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false; @@ -2060,7 +2060,7 @@ foperator_unordered_ge::op1_range (frange &r, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op2.known_isnan () || op2.maybe_isnan ()) + if (op2.maybe_isnan ()) r.set_varying (type); else if (op2.undefined_p ()) return false; @@ -2094,7 +2094,7 @@ foperator_unordered_ge::op2_range (frange &r, tree type, switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: - if (op1.known_isnan () || op1.maybe_isnan ()) + if (op1.maybe_isnan ()) r.set_varying (type); else if (op1.undefined_p ()) return false;