From patchwork Fri Oct 29 15:52:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 46793 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 E0DB63858036 for ; Fri, 29 Oct 2021 15:53:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0DB63858036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635522823; bh=aHnL4aQ0f97PlmOTc9tMGa6LXlu5puNa6Ow+KDG05e4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Z11NmQ3lUJCrquOcPbGCFQowCAcj5JLnsDowXHm+RcVdiFN/09gG6T1nTosaW39OC A0wbO6thb/MJmTchVs4EY2ZR2Yf0sLo77kDqszlXMexf+Wh/f3DVdVORbDO7L5rGIO idRXf2Jxixl8FgcoMspUPe+2yVoEEV5wX95jt0JU= 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 0799E3858410 for ; Fri, 29 Oct 2021 15:53:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0799E3858410 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-216-8lVz1Ym9OpSiZLzQ3DhYgg-1; Fri, 29 Oct 2021 11:53:09 -0400 X-MC-Unique: 8lVz1Ym9OpSiZLzQ3DhYgg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F3D61023F4D for ; Fri, 29 Oct 2021 15:53:09 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3EE05F4EC; Fri, 29 Oct 2021 15:53:08 +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 19TFr5c1656160 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 29 Oct 2021 17:53:06 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 19TFr5wJ656159; Fri, 29 Oct 2021 17:53:05 +0200 To: GCC patches Subject: [COMMITTED] path oracle: Do not look back to the root oracle for killing defs. Date: Fri, 29 Oct 2021 17:52:59 +0200 Message-Id: <20211029155259.656083-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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_H2, 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Since registering a kill means removing all references to it from the path oracle list, make sure we don't look back to the root oracle either. Tested on x86-64 Linux. Co-authored-by: Andrew MacLeod gcc/ChangeLog: * value-relation.cc (path_oracle::killing_def): Add a self-equivalence so we don't look to the root oracle. --- gcc/value-relation.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 512b51ce022..f572bcd4dc2 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -1302,11 +1302,22 @@ path_oracle::killing_def (tree ssa) // 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); } + else + bitmap_set_bit (m_equiv.m_names, v); + + // Now add an equivalency with itself so we don't look to the root oracle. + 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; // Walk the relation list and remove SSA from any relations. if (!bitmap_bit_p (m_relations.m_names, v))