From patchwork Sun Jul 24 15:04:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 56287 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 120B63851C0C for ; Sun, 24 Jul 2022 15:05:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 120B63851C0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658675110; bh=pJAGbHzeGE4jfn4E9e47ktODgvChK0MruxePydMsglU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xeUrYZbhnN2P3a+vpqIa+OhbqixCAvKYHXo0o1F4iqIawFOaYKu1U/SNDES+BT5QN 4yApxjAYigqCpmZq8YVdb5ALco36MEd4XRkQnIIjYPdzm5Ht0qEK+RRvgSEXwvIwis s9RoIWyXD2Urb4Ag9mUK3bJFRzw9/gaQrQQnOlTc= 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 047A03858428 for ; Sun, 24 Jul 2022 15:04:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 047A03858428 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-640-NCmQHvkiMzqxYTfIlVdgIg-1; Sun, 24 Jul 2022 11:04:39 -0400 X-MC-Unique: NCmQHvkiMzqxYTfIlVdgIg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2785A3804501 for ; Sun, 24 Jul 2022 15:04:39 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C0116141511F; Sun, 24 Jul 2022 15:04:38 +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 26OF4bvs2010505 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 24 Jul 2022 17:04:37 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 26OF4bfi2010504; Sun, 24 Jul 2022 17:04:37 +0200 To: GCC patches Subject: [COMMITTED] Allow registering same SSA name relations in oracle. Date: Sun, 24 Jul 2022 17:04:29 +0200 Message-Id: <20220724150431.2010479-2-aldyh@redhat.com> In-Reply-To: <20220724150431.2010479-1-aldyh@redhat.com> References: <20220724150431.2010479-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 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, 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.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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Similarly to what we did for the relation oracle, but for the path oracle. This was found while working on frange, where we can test for x == x while checking for NANness. Tested on x86-64 Linux. gcc/ChangeLog: * value-relation.cc (value_relation::set_relation): Remove assert. (path_oracle::register_relation): Exit when trying to register same SSA name relations. --- gcc/value-relation.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index bd344253af3..a447021214f 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -667,8 +667,6 @@ private: inline void value_relation::set_relation (relation_kind r, tree n1, tree n2) { - gcc_checking_assert (SSA_NAME_VERSION (n1) != SSA_NAME_VERSION (n2) - || r == VREL_EQ); related = r; name1 = n1; name2 = n2; @@ -1449,6 +1447,11 @@ void path_oracle::register_relation (basic_block bb, relation_kind k, tree ssa1, tree ssa2) { + // If the 2 ssa_names are the same, do nothing. An equivalence is implied, + // and no other relation makes sense. + if (ssa1 == ssa2) + return; + if (dump_file && (dump_flags & TDF_DETAILS)) { value_relation vr (k, ssa1, ssa2);