From patchwork Tue Nov 9 11:14:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1552924 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=ONN0UXwu; 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 4HpQPw2BPmz9sCD for ; Tue, 9 Nov 2021 22:15:30 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C2A23858437 for ; Tue, 9 Nov 2021 11:15:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C2A23858437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636456528; bh=/5JyYoaufJ2tsa7NOarBJP/VJTYBe2R04347EAwMlbc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ONN0UXwueFdMPx9tJ6Uq/wn33jKzz9vfrWziWGCivgbA4kXqVlbFegnt/hTSxevQN w/MPH1aUWen009VG9092W7sDk8zX2DQwesEKEjq/cRD6uVKG+KsHkwqFCm8Jm/fg/A dU96QPenj0M/J37xUesn7WzSYeE+BKyl+3S2/P0U= 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 0F8213858D39 for ; Tue, 9 Nov 2021 11:14:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F8213858D39 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-560-6A-dhs6uNjS7tt5Dj9x4xw-1; Tue, 09 Nov 2021 06:14:44 -0500 X-MC-Unique: 6A-dhs6uNjS7tt5Dj9x4xw-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 11730101796C for ; Tue, 9 Nov 2021 11:14:44 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97C2C19C79; Tue, 9 Nov 2021 11:14:43 +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 1A9BEfeD361563 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 9 Nov 2021 12:14:41 +0100 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.16.1/8.16.1/Submit) id 1A9BEfGa361562; Tue, 9 Nov 2021 12:14:41 +0100 To: GCC patches Subject: [COMMITTED] Cleanup path solver dumps. Date: Tue, 9 Nov 2021 12:14:37 +0100 Message-Id: <20211109111437.361501-2-aldyh@redhat.com> In-Reply-To: <20211109111437.361501-1-aldyh@redhat.com> References: <20211109111437.361501-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.3 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch makes the path solver dumps a bit more consistent. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-path.cc (path_range_query::dump): Clean up. (path_range_query::compute_ranges): Same. * value-relation.cc (path_oracle::dump): Same. --- gcc/gimple-range-path.cc | 11 ++++------- gcc/value-relation.cc | 6 +++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index 52de10369f3..99ac947581b 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -98,7 +98,6 @@ path_range_query::dump (FILE *dump_file) unsigned i; bitmap_iterator bi; - fprintf (dump_file, "\nPath is (length=%d):\n", m_path->length ()); dump_ranger (dump_file, *m_path); fprintf (dump_file, "Imports:\n"); @@ -505,7 +504,7 @@ path_range_query::compute_ranges (const vec &path, const bitmap_head *imports) { if (DEBUG_SOLVER) - fprintf (dump_file, "\n*********** path_range_query ******************\n"); + fprintf (dump_file, "\n==============================================\n"); set_path (path); bitmap_copy (m_imports, imports); @@ -519,13 +518,13 @@ path_range_query::compute_ranges (const vec &path, if (DEBUG_SOLVER) { - fprintf (dump_file, "\npath_range_query: compute_ranges for path: "); + fprintf (dump_file, "path_range_query: compute_ranges for path: "); for (unsigned i = path.length (); i > 0; --i) { basic_block bb = path[i - 1]; - fprintf (dump_file, "BB %d", bb->index); + fprintf (dump_file, "%d", bb->index); if (i > 1) - fprintf (dump_file, ", "); + fprintf (dump_file, "->"); } fprintf (dump_file, "\n"); } @@ -557,9 +556,7 @@ path_range_query::compute_ranges (const vec &path, if (DEBUG_SOLVER) { - fprintf (dump_file, "\npath_oracle:\n"); get_path_oracle ()->dump (dump_file); - fprintf (dump_file, "\n"); dump (dump_file); } } diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index a0105481466..9c3ecd94b13 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -1448,10 +1448,14 @@ void path_oracle::dump (FILE *f) const { equiv_chain *ptr = m_equiv.m_next; + relation_chain *ptr2 = m_relations.m_head; + + if (ptr || ptr2) + fprintf (f, "\npath_oracle:\n"); + for (; ptr; ptr = ptr->m_next) ptr->dump (f); - relation_chain *ptr2 = m_relations.m_head; for (; ptr2; ptr2 = ptr2->m_next) { fprintf (f, "Relational : ");