From patchwork Fri Sep 24 14:50:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 45417 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 783A0385801E for ; Fri, 24 Sep 2021 14:51:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 783A0385801E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632495099; bh=vroEdj8lkuQrKPFO31PX1lXZxCQAFCJEtVm7Jv8KVKM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=wgfxXMq8ZLXis4k8L3dXmzrHDLLk9E9hv5G/00lO6bNIF1XaLZNDmgDCpGANEFe5o naR6k9d3rjDrqX6wdXVAaTY9KykLZjQbDMu6HtsgTOa7EW9jdXu9Z77W/CD80YtHYL /CLQoG33RD7hvO0dX7GFLjHKWG7bq40NZSHwU9a8= 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 E6B283858402 for ; Fri, 24 Sep 2021 14:51:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6B283858402 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-486-3yveV77RMM-2nwMXuOfcdA-1; Fri, 24 Sep 2021 10:51:07 -0400 X-MC-Unique: 3yveV77RMM-2nwMXuOfcdA-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 941E71006AB6 for ; Fri, 24 Sep 2021 14:51:06 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.251]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27F7E19D9B; Fri, 24 Sep 2021 14:50:56 +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 18OEosW81100138 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 24 Sep 2021 16:50:54 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 18OEosIW1100137; Fri, 24 Sep 2021 16:50:54 +0200 To: Andrew MacLeod Subject: [COMMITTED] path solver: Avoid further lookups when range is defined in block. Date: Fri, 24 Sep 2021 16:50:51 +0200 Message-Id: <20210924145051.1100082-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.8 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 Cc: GCC patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" If an SSA is defined in the current block, there is no need to query range_on_path_entry for additional information. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::path_range_query): Move debugging header... (path_range_query::precompute_ranges): ...here. (path_range_query::internal_range_of_expr): Do not call range_on_path_entry if NAME is defined in the current block. --- gcc/gimple-range-path.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index d9704c8f86b..0738a5ca159 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -39,9 +39,6 @@ along with GCC; see the file COPYING3. If not see path_range_query::path_range_query (gimple_ranger &ranger, bool resolve) : m_ranger (ranger) { - if (DEBUG_SOLVER) - fprintf (dump_file, "\n*********** path_range_query ******************\n"); - m_cache = new ssa_global_cache; m_has_cache_entry = BITMAP_ALLOC (NULL); m_path = NULL; @@ -173,9 +170,6 @@ path_range_query::internal_range_of_expr (irange &r, tree name, gimple *stmt) if (TREE_CODE (name) == SSA_NAME) r.intersect (gimple_range_global (name)); - if (m_resolve && r.varying_p ()) - range_on_path_entry (r, name); - set_cache (r, name); return true; } @@ -467,6 +461,9 @@ void path_range_query::precompute_ranges (const vec &path, const bitmap_head *imports) { + if (DEBUG_SOLVER) + fprintf (dump_file, "\n*********** path_range_query ******************\n"); + set_path (path); bitmap_copy (m_imports, imports); m_undefined_path = false;