From patchwork Tue Apr 16 17:47:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bergner X-Patchwork-Id: 1086515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499339-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Rk8OvWZV"; dkim-atps=neutral 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 44kCWr437sz9s55 for ; Wed, 17 Apr 2019 03:48:06 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=yP8rd nsMS6d6tGCfYKmBcFVJODhVPMQ7rdoaef5M32EmU4HkHRXPCIfXMdRkig+oWL7HF PR3iFwqfyh0TBViq2z4RSQn2I+OCV5GFEYCzpDjddLQQyMuR2FTJU37LfD4jUNaO KEwwUBO2y82SAiEMJ3h61lAkkjK/Kaei+c7mPM= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=6hZkgf1XsA1 IgFXPESjOkIEPjZM=; b=Rk8OvWZVtx/ee7GupcWY5PWs24IjrzAXubVZyf2wDdD +SPc263vG+47BqEPIMX6tYnW7RgUriWTQuRk8ZT1/gFynG6r8EZmsy+QWU5u3QdL Ciodvdb6Q0udzfp62T+rvEEWlmDPOZfteFpcg6uMQCfgxMeOSKAH9yUTGSBtDy0A = Received: (qmail 70422 invoked by alias); 16 Apr 2019 17:47:59 -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 70403 invoked by uid 89); 16 Apr 2019 17:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=ns, H*MI:49dd, guarding X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Apr 2019 17:47:56 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3GHivuU111155 for ; Tue, 16 Apr 2019 13:47:53 -0400 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2rwknt87qf-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Apr 2019 13:47:53 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Apr 2019 18:47:52 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 16 Apr 2019 18:47:50 +0100 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3GHlm9J10158262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Apr 2019 17:47:49 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BC729136059; Tue, 16 Apr 2019 17:47:48 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22BD7136055; Tue, 16 Apr 2019 17:47:48 +0000 (GMT) Received: from otta.local (unknown [9.80.223.219]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 16 Apr 2019 17:47:47 +0000 (GMT) To: GCC Patches Cc: Vladimir N Makarov From: Peter Bergner Subject: [PATCH] Fixup IRA debug dump output Date: Tue, 16 Apr 2019 12:47:47 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 x-cbid: 19041617-0020-0000-0000-00000ED86E67 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010938; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000284; SDB=6.01189993; UDB=6.00623541; IPR=6.00970788; MB=3.00026469; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-16 17:47:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041617-0021-0000-0000-00006574BDDF Message-Id: <5dc578d9-49dd-d664-c8bc-ce7a322e9dd3@linux.ibm.com> X-IsSubscribed: yes In looking at the IRA dumps from PR87871, I see that we're missing some \n's in the output of an allocno's conflicts and we fail to even print the lines for the hard reg conflicts. This causes us to start printing the copy and shuffle info on the same line as the alloc conflicts, like so: ;; a5(r116,l0) conflicts: cp0:a0(r111)<->a4(r117)@330:move cp1:a2(r114)<->a3(r112)@41:shuffle cp2:a3(r112)<->a5(r116)@125:shuffle pref0:a0(r111)<-hr0@2000 pref1:a4(r117)<-hr0@660 pref2:a5(r116)<-hr0@1000 regions=1, blocks=6, points=10 allocnos=6 (big 0), copies=3, conflicts=0, ranges=6 The patch below fixes the issue not continuing if the allocno's conflict array is null and instead guarding the current conflict prints by that test. If the conflict array is null, we instead now print out simple empty conflict info. This now gives us what we'd expect to see: ;; a5(r116,l0) conflicts: ;; total conflict hard regs: ;; conflict hard regs: cp0:a0(r111)<->a4(r117)@330:move cp1:a2(r114)<->a3(r112)@41:shuffle pref0:a0(r111)<-hr0@2000 pref1:a4(r117)<-hr0@660 pref2:a5(r116)<-hr0@1000 regions=1, blocks=6, points=10 allocnos=6 (big 0), copies=2, conflicts=0, ranges=6 ... Ok for mainline once we hit stage1 again? Unless people want this now, given it's only debug output used when -fdump-rtl-ira is used. Peter * ira-conflicts.c (print_allocno_conflicts): Always print something, even for allocno's with no conflicts. (print_conflicts): Print an extra newline. Index: gcc/ira-conflicts.c =================================================================== --- gcc/ira-conflicts.c (revision 270331) +++ gcc/ira-conflicts.c (working copy) @@ -632,45 +630,50 @@ print_allocno_conflicts (FILE * file, bo ira_object_t conflict_obj; ira_object_conflict_iterator oci; - if (OBJECT_CONFLICT_ARRAY (obj) == NULL) - continue; - if (n > 1) - fprintf (file, "\n;; subobject %d:", i); - FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci) + if (OBJECT_CONFLICT_ARRAY (obj) != NULL) { - ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj); - if (reg_p) - fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a)); - else + if (n > 1) + fprintf (file, "\n;; subobject %d:", i); + FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci) { - fprintf (file, " a%d(r%d", ALLOCNO_NUM (conflict_a), - ALLOCNO_REGNO (conflict_a)); - if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1) - fprintf (file, ",w%d", OBJECT_SUBWORD (conflict_obj)); - if ((bb = ALLOCNO_LOOP_TREE_NODE (conflict_a)->bb) != NULL) - fprintf (file, ",b%d", bb->index); + ira_allocno_t conflict_a = OBJECT_ALLOCNO (conflict_obj); + if (reg_p) + fprintf (file, " r%d,", ALLOCNO_REGNO (conflict_a)); else - fprintf (file, ",l%d", - ALLOCNO_LOOP_TREE_NODE (conflict_a)->loop_num); - putc (')', file); + { + fprintf (file, " a%d(r%d", ALLOCNO_NUM (conflict_a), + ALLOCNO_REGNO (conflict_a)); + if (ALLOCNO_NUM_OBJECTS (conflict_a) > 1) + fprintf (file, ",w%d", OBJECT_SUBWORD (conflict_obj)); + if ((bb = ALLOCNO_LOOP_TREE_NODE (conflict_a)->bb) != NULL) + fprintf (file, ",b%d", bb->index); + else + fprintf (file, ",l%d", + ALLOCNO_LOOP_TREE_NODE (conflict_a)->loop_num); + putc (')', file); + } } + COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj)); + AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); + AND_HARD_REG_SET (conflicting_hard_regs, + reg_class_contents[ALLOCNO_CLASS (a)]); + print_hard_reg_set (file, "\n;; total conflict hard regs:", + conflicting_hard_regs); + + COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_CONFLICT_HARD_REGS (obj)); + AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); + AND_HARD_REG_SET (conflicting_hard_regs, + reg_class_contents[ALLOCNO_CLASS (a)]); + print_hard_reg_set (file, ";; conflict hard regs:", + conflicting_hard_regs); + } + else + { + fprintf (file, "\n;; total conflict hard regs:\n"); + fprintf (file, ";; conflict hard regs:\n"); } - COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj)); - AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); - AND_HARD_REG_SET (conflicting_hard_regs, - reg_class_contents[ALLOCNO_CLASS (a)]); - print_hard_reg_set (file, "\n;; total conflict hard regs:", - conflicting_hard_regs); - - COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_CONFLICT_HARD_REGS (obj)); - AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); - AND_HARD_REG_SET (conflicting_hard_regs, - reg_class_contents[ALLOCNO_CLASS (a)]); - print_hard_reg_set (file, ";; conflict hard regs:", - conflicting_hard_regs); putc ('\n', file); } - } /* Print information about allocno or only regno (if REG_P) conflicts @@ -683,6 +686,7 @@ print_conflicts (FILE *file, bool reg_p) FOR_EACH_ALLOCNO (a, ai) print_allocno_conflicts (file, reg_p, a); + putc ('\n', file); } /* Print information about allocno or only regno (if REG_P) conflicts