From patchwork Mon Oct 9 17:10:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 1845411 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=G0UISMVn; 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 4S45CD28CPz1yq1 for ; Tue, 10 Oct 2023 04:10:47 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5599D3856DDC for ; Mon, 9 Oct 2023 17:10:43 +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 DCC3C3858408 for ; Mon, 9 Oct 2023 17:10:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCC3C3858408 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=1696871428; 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; bh=ZqnActL/gCbSp8Nvcn+IwOmdRDZED0LTabkmQO6v9ko=; b=G0UISMVnNaGNc3BTSvDfzRUhCFDNLGnoEOP6+aLmpI9Dkq99pbFH9MxPkzGJcRQiMx0aUy ECoyQq1DAMbdYyFN+tDupaY3vkEQ1FE5Vp3QC4sf7JQ6/4TaMMPyyJlcRH64XkqVJv4LA9 uj9XX3jw6TPF5ZWW7FmZMtY4lL/7AIc= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-EQhXBTuNMluJRy-6daqjYQ-1; Mon, 09 Oct 2023 13:10:26 -0400 X-MC-Unique: EQhXBTuNMluJRy-6daqjYQ-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-775d995f92aso634736885a.1 for ; Mon, 09 Oct 2023 10:10:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696871425; x=1697476225; h=cc:subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7rlFfJWCtyCJRVGl77gePrqAzqSVfZiOHR8rf8PZ310=; b=iQ5456aK3XfeYeovCi2k7AfRIa2dDRlpc1xAdUW/No5SQavuAz06Ie8nlFfRmpsDby izXzXyOTMCoYNOXzr/0C9iytCYH/5NORBtu7TPZ/vi+OwTi8hem57LBnRXMuYEyOLuE2 q6GGJ3z1sZuamoMnq7XobTIxPmH02Rz4yUADiwWamHNRyfKE7zGVAqc/81kgUeGhnpXx C5e1nfCd5aD7Pc6B6x3qKA5hbrXJ8tAwPZmQ/1drYb6FvQkU+S+AUSc9V8x2Mz1CzhYU FgNOMzQXQO/GUljeqkNiVPAlZknvQSkZMiSOgcId1Sy9MlcrhWt+tDArp5cSYw/pIC9m Yh8Q== X-Gm-Message-State: AOJu0YwNGuKkxb19KcdTcR/0kb2iReHPAg+36GsB65U2/f73k1s/fodX d3evOJOvL3EVtGhN3edufLWbWxWBU7rvy43LncuQSy2A2C78QHR4SHmJnOec6Aa5c+Z41Q9dKfQ xY6r+qFbFoX+Z8Dm69KdND1s2RNKU7JUUstcgYtrO44wjAIlv6n1UL1H92tPiKdhVkqf3ol87i9 gEqA== X-Received: by 2002:a05:620a:b5b:b0:76e:f149:fb43 with SMTP id x27-20020a05620a0b5b00b0076ef149fb43mr15760523qkg.70.1696871425378; Mon, 09 Oct 2023 10:10:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWyqYTsqQLxipe7xbGf/4atQX5Y9CzQQBLx49fJJi6CoxiVA0L7WJl4hnIXqWyNaR0gC31NA== X-Received: by 2002:a05:620a:b5b:b0:76e:f149:fb43 with SMTP id x27-20020a05620a0b5b00b0076ef149fb43mr15760510qkg.70.1696871425062; Mon, 09 Oct 2023 10:10:25 -0700 (PDT) Received: from [192.168.0.174] ([104.219.124.252]) by smtp.gmail.com with ESMTPSA id vq2-20020a05620a558200b0076f058f5834sm3658617qkn.61.2023.10.09.10.10.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 10:10:24 -0700 (PDT) Message-ID: <05ff6998-7583-0d88-e959-35528bb7f37a@redhat.com> Date: Mon, 9 Oct 2023 13:10:28 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: gcc-patches From: Andrew MacLeod Subject: [COMMITTED] Remove unused get_identity_relation. Cc: "hernandez, aldy" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-11.8 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 I added this routine for Aldy when he thought we were going to have to add explicit versions for unordered relations. It seems that with accurate tracking of NANs, we do not need the explicit versions in the oracle, so we will not need this identity routine to pick the appropriate version of VREL_EQ... as there is only one.  As it stands, always returns VREL_EQ, so simply use VREL_EQ in the 2 calling locations. Bootstrapped on x86_64-pc-linux-gnu with no regressions. Pushed. Andrew From 5ee51119d1345f3f13af784455a4ae466766912b Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Mon, 9 Oct 2023 10:01:11 -0400 Subject: [PATCH 1/2] Remove unused get_identity_relation. Turns out we didnt need this as there is no unordered relations managed by the oracle. * gimple-range-gori.cc (gori_compute::compute_operand1_range): Do not call get_identity_relation. (gori_compute::compute_operand2_range): Ditto. * value-relation.cc (get_identity_relation): Remove. * value-relation.h (get_identity_relation): Remove protyotype. --- gcc/gimple-range-gori.cc | 10 ++-------- gcc/value-relation.cc | 14 -------------- gcc/value-relation.h | 3 --- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 1b5eda43390..887da0ff094 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -1146,10 +1146,7 @@ gori_compute::compute_operand1_range (vrange &r, // If op1 == op2, create a new trio for just this call. if (op1 == op2 && gimple_range_ssa_p (op1)) - { - relation_kind k = get_identity_relation (op1, op1_range); - trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), k); - } + trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ); if (!handler.calc_op1 (r, lhs, op2_range, trio)) return false; } @@ -1225,10 +1222,7 @@ gori_compute::compute_operand2_range (vrange &r, // If op1 == op2, create a new trio for this stmt. if (op1 == op2 && gimple_range_ssa_p (op1)) - { - relation_kind k = get_identity_relation (op1, op1_range); - trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), k); - } + trio = relation_trio (trio.lhs_op1 (), trio.lhs_op2 (), VREL_EQ); // Intersect with range for op2 based on lhs and op1. if (!handler.calc_op2 (r, lhs, op1_range, trio)) return false; diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 8fea4aad345..a2ae39692a6 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -183,20 +183,6 @@ relation_transitive (relation_kind r1, relation_kind r2) return relation_kind (rr_transitive_table[r1][r2]); } -// When operands of a statement are identical ssa_names, return the -// approriate relation between operands for NAME == NAME, given RANGE. -// -relation_kind -get_identity_relation (tree name, vrange &range ATTRIBUTE_UNUSED) -{ - // Return VREL_UNEQ when it is supported for floats as appropriate. - if (frange::supports_p (TREE_TYPE (name))) - return VREL_EQ; - - // Otherwise return VREL_EQ. - return VREL_EQ; -} - // This vector maps a relation to the equivalent tree code. static const tree_code relation_to_code [VREL_LAST] = { diff --git a/gcc/value-relation.h b/gcc/value-relation.h index f00f84f93b6..be6e277421b 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -91,9 +91,6 @@ inline bool relation_equiv_p (relation_kind r) void print_relation (FILE *f, relation_kind rel); -// Return relation for NAME == NAME with RANGE. -relation_kind get_identity_relation (tree name, vrange &range); - class relation_oracle { public: -- 2.41.0