From patchwork Thu Nov 3 16:35:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 690910 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t8rDp3lkjz9t0J for ; Fri, 4 Nov 2016 03:35:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=dwzBJwkc; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=AxIaIpwTx3r5qp366aSDhigcfH1gwdYMGYMryDGFUgII4OohQz /zC+JnCn8OCPQqNme6cJZDt9ijqWqJ7QaUfyixzP+YigB56B5pgtfe4qs9Gi0h4P 6X2jS59Ckll4lbsvipBzUD+exkcooX5bFwg+ERBdmq/+4FRkGwysn9cjs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=wzS8Do+Ij/AiFq+zy+8ak6FEdso=; b=dwzBJwkcTds5xxZe8FPM EympEiDcvAG9wqhYeSYErXyW6lbPPPKndC4876h+/aZc2vbZfQ272vsCydnLpls2 N47/rcSDR2pzLp6j7o46JrY0EZwg/3Jy8jZB8TbT2/mpj4NE7omaj2dOf8S1XzeB Vqqdofyg8pb1UXsLI82BvsM= Received: (qmail 85151 invoked by alias); 3 Nov 2016 16:35:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 85138 invoked by uid 89); 3 Nov 2016 16:35:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=Hubicka, Hx-languages-length:1512, yesterday, our X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Nov 2016 16:35:18 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4867FAD16 for ; Thu, 3 Nov 2016 16:35:14 +0000 (UTC) Date: Thu, 3 Nov 2016 17:35:14 +0100 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka Subject: [PATCH] Print repeated rtl vector elements in a nicer way Message-ID: <20161103163514.eg5rdeev7eic5svc@virgil.suse.cz> Mail-Followup-To: GCC Patches , Jan Hubicka MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes Hi, this patch comes from our GCN BE branch. Because vectors of that architectures have many elements, RTL dumps can get quite unwieldy when all elements are printed out all the time. However, pretty much all the time it is the same value repeated over and over again, which lead us to the following patch which just prints how many times a given value occurs. Honza has asked me yesterday to submit this hunk upstream so here it is. It has passed bootstrap and testing on x86_64-linux and aarch64-linux, OK for trunk? Thanks, Martin 2016-11-02 Jan Hubicka Martin Jambor * print-rtl.c (print_rtx_operand_codes_E_and_V): Print how many times an element is repeated istead of printing each repeated element. --- gcc/print-rtl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 341ecdf..9752c85 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -252,7 +252,20 @@ rtx_writer::print_rtx_operand_codes_E_and_V (const_rtx in_rtx, int idx) m_sawclose = 1; for (int j = 0; j < XVECLEN (in_rtx, idx); j++) - print_rtx (XVECEXP (in_rtx, idx, j)); + { + int j1; + + print_rtx (XVECEXP (in_rtx, idx, j)); + for (j1 = j + 1; j1 < XVECLEN (in_rtx, idx); j1++) + if (XVECEXP (in_rtx, idx, j) != XVECEXP (in_rtx, idx, j1)) + break; + + if (j1 != j + 1) + { + fprintf (m_outfile, " repeated %ix", j1 - j); + j = j1; + } + } m_indent -= 2; }