From patchwork Thu Oct 28 15:23:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1547575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=csYtHDat; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hg8Wd2KTHz9sP7 for ; Fri, 29 Oct 2021 02:25:16 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C1BC3857802 for ; Thu, 28 Oct 2021 15:25:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C1BC3857802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635434713; bh=tVypkuPnbY+QqGvZJBBAoRqw5jLyV8LmS6whd486sp0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=csYtHDatC+L2E9D+citMwgarsqa+Jjgz8ZZ0NhdT+o02o2vSK+WVe9njHaX8nQ0b3 55LTY9UIIeZT5QS4j2xWDdAc8AlE7xhIs5Cs+ipsNg8SnEzCv2GBjhiN+3eH+EO8oP 4Ol7wpch2YAA7yGCiXx/7RGaiTrqdIGWNi1Jlpko= 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 AD3E03858410 for ; Thu, 28 Oct 2021 15:24:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD3E03858410 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-jkzQ2st6NdWCEAWntTX0-A-1; Thu, 28 Oct 2021 11:24:29 -0400 X-MC-Unique: jkzQ2st6NdWCEAWntTX0-A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B83E68066F6 for ; Thu, 28 Oct 2021 15:24:28 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99DF026DC1; Thu, 28 Oct 2021 15:24:02 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.16.1/8.15.2) with ESMTPS id 19SFNxJo522438 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 17:24:00 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 19SFNxj6522437; Thu, 28 Oct 2021 17:23:59 +0200 To: GCC patches Subject: [PATCH] path relation oracle: Remove SSA's being killed from the equivalence list. Date: Thu, 28 Oct 2021 17:23:54 +0200 Message-Id: <20211028152354.522386-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.0 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, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Same thing as the relational change. Walk any equivalences that have been registered on the path, and remove the name being killed. The only reason we had added the equivalence with itself earlier is so we wouldn't search any further in the equivalency list. So if we are removing all references to it, then we no longer need to add a "kill" record. Will push pending tests on x86-64 Linux. Co-authored-by: Andrew MacLeod gcc/ChangeLog: * value-relation.cc (path_oracle::killing_def): Walk the equivalency list and remove SSA from any equivalencies. --- gcc/value-relation.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 0ad4f7a9495..512b51ce022 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -1298,17 +1298,17 @@ path_oracle::killing_def (tree ssa) } unsigned v = SSA_NAME_VERSION (ssa); - bitmap b = BITMAP_ALLOC (&m_bitmaps); - bitmap_set_bit (b, v); - equiv_chain *ptr = (equiv_chain *) obstack_alloc (&m_chain_obstack, - sizeof (equiv_chain)); - ptr->m_names = b; - ptr->m_bb = NULL; - ptr->m_next = m_equiv.m_next; - m_equiv.m_next = ptr; - bitmap_ior_into (m_equiv.m_names, b); - // Walk the relation list an remove SSA from any relations. + // Walk the equivalency list and remove SSA from any equivalencies. + if (bitmap_bit_p (m_equiv.m_names, v)) + { + bitmap_clear_bit (m_equiv.m_names, v); + for (equiv_chain *ptr = m_equiv.m_next; ptr; ptr = ptr->m_next) + if (bitmap_bit_p (ptr->m_names, v)) + bitmap_clear_bit (ptr->m_names, v); + } + + // Walk the relation list and remove SSA from any relations. if (!bitmap_bit_p (m_relations.m_names, v)) return;