From patchwork Fri Oct 1 12:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 45676 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 0ECE53857C73 for ; Fri, 1 Oct 2021 12:43:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0ECE53857C73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633092236; bh=MkHRetXUl+wdXNqGy8g3Q8UZSZSKs6pptyo+siLSc68=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Bby38L6gWFe2ON5kv4qKIKa0iP6czBxQf2qZxkhsdmhs7WQCwx0A/tLDJv6RnAcbv 6fOdR0l8I4lsmj8/Pe+rnVRHcP/Ac1vUJfU2Dg5lVal7QQ26AMhjj8+nYaGgS6psDr AdQ4DrpYEW3lh4XdxrD1TsGqnvR2QLXFiuOd/9ds= 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 ESMTP id 5A3543858C2C for ; Fri, 1 Oct 2021 12:43:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A3543858C2C 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-536-BuDgclRYPea-g0EqwqCziA-1; Fri, 01 Oct 2021 08:43:24 -0400 X-MC-Unique: BuDgclRYPea-g0EqwqCziA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 243AE802928 for ; Fri, 1 Oct 2021 12:43:23 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6A5B652A4; Fri, 1 Oct 2021 12:43:16 +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 191ChEnm1458275 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 1 Oct 2021 14:43:14 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 191ChD6m1458274; Fri, 1 Oct 2021 14:43:13 +0200 To: GCC patches Subject: [COMMITTED] Remove shadowed oracle field. Date: Fri, 1 Oct 2021 14:43:04 +0200 Message-Id: <20211001124306.1458223-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.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_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TVD_SUBJ_WIPE_DEBT, 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" The m_oracle field in the path solver was shadowing the base class. This was causing subtle problems while calculating outgoing edges between blocks, because the query object being passed did not have an oracle set. This should further improve our solving ability. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::compute_ranges): Use get_path_oracle. * gimple-range-path.h (class path_range_query): Remove shadowed m_oracle field. (path_range_query::get_path_oracle): New. --- gcc/gimple-range-path.cc | 2 +- gcc/gimple-range-path.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index a29d5318ca9..422abfddb8f 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -480,7 +480,7 @@ path_range_query::compute_ranges (const vec &path, if (m_resolve) { add_copies_to_imports (); - m_oracle->reset_path (); + get_path_oracle ()->reset_path (); compute_relations (path); } diff --git a/gcc/gimple-range-path.h b/gcc/gimple-range-path.h index cf49c6dc086..5f4e73a5949 100644 --- a/gcc/gimple-range-path.h +++ b/gcc/gimple-range-path.h @@ -38,7 +38,6 @@ public: bool range_of_expr (irange &r, tree name, gimple * = NULL) override; bool range_of_stmt (irange &r, gimple *, tree name = NULL) override; bool unreachable_path_p (); - path_oracle *oracle () { return m_oracle; } void dump (FILE *) override; void debug (); @@ -46,6 +45,7 @@ private: bool internal_range_of_expr (irange &r, tree name, gimple *); bool defined_outside_path (tree name); void range_on_path_entry (irange &r, tree name); + path_oracle *get_path_oracle () { return (path_oracle *)m_oracle; } // Cache manipulation. void set_cache (const irange &r, tree name); @@ -85,7 +85,6 @@ private: auto_bitmap m_imports; gimple_ranger &m_ranger; non_null_ref m_non_null; - path_oracle *m_oracle; // Current path position. unsigned m_pos;