From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id 21F6A3857819 for ; Fri, 29 Oct 2021 07:25:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 21F6A3857819 Received: by mail-ed1-x535.google.com with SMTP id m17so34235153edc.12 for ; Fri, 29 Oct 2021 00:25:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zapsAsGL+nM5GRV6itx4uS9/JeByadUkoNHq5FMmQVg=; b=rWNTVhNNc6pHXBSKfbsLtzU6vXrXIJKTZWrs85oe8Baq5pfK01btZ3gbnVEd1M5ipW 2rZQD4W6ALD+foF7a0FSJS6bE3/+p/ZpZKiyDvw9na3CBDNfHh3IC/xY9PATCMpWpwpP ilH7xENqxm8eH8IHbAiBeIRzgrkWCQ5qeE/hPJm4k+52gWv05KCwM5AWigqvwq9eJVWB WTZvL8q7dePKsUudlxdgg93QuUFBwGNspQO7w5tqKlOQajhEmrp3RgZRUn5h4w4Ec71h aij+4OlCWUcH5RRakVnpYcahlcNzoZ+zrkuO5TsUb+CioXIq44IOYsqo1ysVTn/1Hef5 0WSg== X-Gm-Message-State: AOAM531g3635ghlmG8P0JOWXdMLwZ2Btud1fNOyeIgS7oKwKBwVG8MQ2 KiijkN6QU5nUmKmPG3xfWuKySed5AKXYk7bcsTE= X-Google-Smtp-Source: ABdhPJxNrcKNI77gSPbbV7SzcOBjCmtFHR8cR3i7q97iBZn3HLteYVVoKjX9w2MZNHrSOjMq3gxz+ykBby9w/4WEFlY= X-Received: by 2002:aa7:c656:: with SMTP id z22mr4927544edr.251.1635492299194; Fri, 29 Oct 2021 00:24:59 -0700 (PDT) MIME-Version: 1.0 References: <20211028152354.522386-1-aldyh@redhat.com> In-Reply-To: <20211028152354.522386-1-aldyh@redhat.com> From: Richard Biener Date: Fri, 29 Oct 2021 09:24:48 +0200 Message-ID: Subject: Re: [PATCH] path relation oracle: Remove SSA's being killed from the equivalence list. To: Aldy Hernandez Cc: GCC patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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-List-Received-Date: Fri, 29 Oct 2021 07:25:01 -0000 On Thu, Oct 28, 2021 at 5:25 PM Aldy Hernandez via Gcc-patches wrote: > > 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); What's the reason to do both lookup and clear? Just bitmap_clear_bit () should be good enough. > + } > + > + // Walk the relation list and remove SSA from any relations. > if (!bitmap_bit_p (m_relations.m_names, v)) > return; > > -- > 2.31.1 >