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: 47270 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 2ADA03858001 for ; Tue, 9 Nov 2021 11:15:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2ADA03858001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636456516; 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=Y46yelG+I1Qq9jQ+0OLaQtO6NGMLfVvPvZ98aRLp48BnITavwiG8FUkn+rj1EfAB6 zZwZTcKSDs/qsD9bWQuFsnOYaNc+wY8Brs/SnvSOMJjFQXHEL1F5EwICNHQbR5DivN 3qreb0lHrZ+iz8tmSZZ0zMNVN1IFAZvRw5xihyDo= 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+patchwork=sourceware.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 : ");