From patchwork Mon Jul 22 15:44:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1963302 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WSPk46djCz1yZ7 for ; Tue, 23 Jul 2024 01:45:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C56B4385EC57 for ; Mon, 22 Jul 2024 15:45:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 212463858C52 for ; Mon, 22 Jul 2024 15:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 212463858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 212463858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721663088; cv=none; b=oH5TVzQo1pHrF75+28KcWLQMFLaZXhA/k+YI+rKZ1c2n4+E6EJoRCWncCdiAxvKZMIdOMap0TGxA6B1Sg5RH3S5nbQcbjzIvW2TY33ooqiI6W/n7MWJ335IhiMVS9aQ3L3yDG+sxGKAmKxPLTxv+6OAe0yNxhComkSToikvy3F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721663088; c=relaxed/simple; bh=eZZpabY45LKOFZrPXwcNfoSoFBq8pa91IGApIq3m8Ck=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XIQZjfCvhJznorPCY9Drm4+XgoCLy8W8E2+qmVn8qO3KfXGkW3tICX/nBgt+eBgPS4rVocnSRCTe3+vHqzD1LeHrFMBgSCDvytos9Z1XHo80hX+SGxI/5ORFx/aXPuKzoxavPWzKUJKggBSbAF2WyaYzKQoFGIVB7EkI+4kCjo8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 43D30FEC for ; Mon, 22 Jul 2024 08:45:12 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F4D63F5A1 for ; Mon, 22 Jul 2024 08:44:46 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] rtl-ssa: Add debug routines for def_splay_tree Date: Mon, 22 Jul 2024 16:44:45 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-19.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch adds debug routines for def_splay_tree, which I found useful while debugging PR116009. Bootstrapped & regression-tested on aarch64-linux-gnu. Pushed as (hopefully) obvious. Richard gcc/ * rtl-ssa/accesses.h (rtl_ssa::pp_def_splay_tree): Declare. (dump, debug): Add overloads for def_splay_tree. * rtl-ssa/accesses.cc (rtl_ssa::pp_def_splay_tree): New function. (dump, debug): Add overloads for def_splay_tree. --- gcc/rtl-ssa/accesses.cc | 15 +++++++++++++++ gcc/rtl-ssa/accesses.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/gcc/rtl-ssa/accesses.cc b/gcc/rtl-ssa/accesses.cc index 5cc05cb4be7..c77a1ff7ea7 100644 --- a/gcc/rtl-ssa/accesses.cc +++ b/gcc/rtl-ssa/accesses.cc @@ -1745,6 +1745,13 @@ rtl_ssa::pp_def_lookup (pretty_printer *pp, def_lookup dl) pp_def_mux (pp, dl.mux); } +// Print TREE to PP. +void +rtl_ssa::pp_def_splay_tree (pretty_printer *pp, def_splay_tree tree) +{ + tree.print (pp, pp_def_node); +} + // Dump RESOURCE to FILE. void dump (FILE *file, resource_info resource) @@ -1787,6 +1794,13 @@ dump (FILE *file, def_lookup result) dump_using (file, pp_def_lookup, result); } +// Print TREE to FILE. +void +dump (FILE *file, def_splay_tree tree) +{ + dump_using (file, pp_def_splay_tree, tree); +} + // Debug interfaces to the dump routines above. void debug (const resource_info &x) { dump (stderr, x); } void debug (const access_info *x) { dump (stderr, x); } @@ -1794,3 +1808,4 @@ void debug (const access_array &x) { dump (stderr, x); } void debug (const def_node *x) { dump (stderr, x); } void debug (const def_mux &x) { dump (stderr, x); } void debug (const def_lookup &x) { dump (stderr, x); } +void debug (const def_splay_tree &x) { dump (stderr, x); } diff --git a/gcc/rtl-ssa/accesses.h b/gcc/rtl-ssa/accesses.h index 27810a02063..7d0d7bcfb50 100644 --- a/gcc/rtl-ssa/accesses.h +++ b/gcc/rtl-ssa/accesses.h @@ -1052,6 +1052,7 @@ void pp_accesses (pretty_printer *, access_array, void pp_def_node (pretty_printer *, const def_node *); void pp_def_mux (pretty_printer *, def_mux); void pp_def_lookup (pretty_printer *, def_lookup); +void pp_def_splay_tree (pretty_printer *, def_splay_tree); } @@ -1063,6 +1064,7 @@ void dump (FILE *, rtl_ssa::access_array, void dump (FILE *, const rtl_ssa::def_node *); void dump (FILE *, rtl_ssa::def_mux); void dump (FILE *, rtl_ssa::def_lookup); +void dump (FILE *, rtl_ssa::def_splay_tree); void DEBUG_FUNCTION debug (const rtl_ssa::resource_info *); void DEBUG_FUNCTION debug (const rtl_ssa::access_info *); @@ -1070,3 +1072,4 @@ void DEBUG_FUNCTION debug (const rtl_ssa::access_array); void DEBUG_FUNCTION debug (const rtl_ssa::def_node *); void DEBUG_FUNCTION debug (const rtl_ssa::def_mux &); void DEBUG_FUNCTION debug (const rtl_ssa::def_lookup &); +void DEBUG_FUNCTION debug (const rtl_ssa::def_splay_tree &);