From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2069.outbound.protection.outlook.com [40.107.104.69]) by sourceware.org (Postfix) with ESMTPS id 8E8A33858D33 for ; Tue, 25 Apr 2023 14:17:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E8A33858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hD8h97rT9L7r28NUx3uPrAu36kjmYAtTwZsr95DzR1c=; b=VEYkmr7vJtxzHPcA/C6K3ZZJkdkWtBxdoHAFjSSA1YfjsFWy8VlshA++g3RpOPe6lG08D6IeCgnLGR+7fQr0HXUWssqrPJRT8rW5z7uociCj3UvFh2xPmJjGkAYjBfvXjORrUdgaObRCf8rkqBAcPEDwJ4YVPlKEuhK0P3u5cY4= Received: from AS9PR06CA0434.eurprd06.prod.outlook.com (2603:10a6:20b:49e::16) by AS4PR08MB7555.eurprd08.prod.outlook.com (2603:10a6:20b:4fd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:17:23 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::89) by AS9PR06CA0434.outlook.office365.com (2603:10a6:20b:49e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.34 via Frontend Transport; Tue, 25 Apr 2023 14:17:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.20 via Frontend Transport; Tue, 25 Apr 2023 14:17:23 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Tue, 25 Apr 2023 14:17:23 +0000 X-CR-MTA-TID: 64aa7808 Received: from b7b2fc7882e0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FBC242CD-FF7C-49F3-A028-95A18DC2C045.1; Tue, 25 Apr 2023 14:17:17 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b7b2fc7882e0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 25 Apr 2023 14:17:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=am1LRsEy82xiWqL8vLcW4zx2VoqpAnTYjW+H4I2RfTg3QZYvE23TlO22ZRbyxaXJYPmgVRQaB8lgnGYYD0GeO3bQO9g+cqfAVdAWQLJQjzVohWNH/tYgMxCqbDtGcT5aPge7ER8ofdqo0BTcV64oG8L5oeIiH03CYZTAH78epyYspivORU0q/+t/GizEEJU9syW1fg4p0leHBHRRMKHVqnuhB2xQ6n2ytD8BQR8NAqDw4iCasz1cawl++ADZGrM7F86Mu6xEkW1bKQ9AlyqBe+6ygEAqaP0kzpCj8xK7m4+5oud37IH86RMzd893i2iJsuG9smWrP2I/jDaI/pXHhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hD8h97rT9L7r28NUx3uPrAu36kjmYAtTwZsr95DzR1c=; b=WUQaMzFk64Z6EiXeiQK0K/5AH1mgQmaqvbM/05Dq5rxwH4g8O9Ku1j0qIyjF9xhqvcXnKoBe5yZbp5yReIgJeKWP0vZVNebrNf/9d6Qodoxku7g+SwwosyO98ir1dYKuzMVVPAfY7nvwqnlys4QByj4vfmS9abNpZ5ZTihLOwcJh/qez4tcjpwnufCt4VsGUm4Sp9BXRo/LD1bxu1i97Qe0ZBoaEKUAAbJGJCHOqz22/SqmbxRSaTZWg/ApEDlMUbArlygrfgq4PxB3nRp/zhwqVvE6jKVM4xzCoKFCTdhkdJIu62jtFo0GU1V8u/syT3Q22kuPWKzn3Kyjn8x0SGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hD8h97rT9L7r28NUx3uPrAu36kjmYAtTwZsr95DzR1c=; b=VEYkmr7vJtxzHPcA/C6K3ZZJkdkWtBxdoHAFjSSA1YfjsFWy8VlshA++g3RpOPe6lG08D6IeCgnLGR+7fQr0HXUWssqrPJRT8rW5z7uociCj3UvFh2xPmJjGkAYjBfvXjORrUdgaObRCf8rkqBAcPEDwJ4YVPlKEuhK0P3u5cY4= Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by VE1PR08MB5744.eurprd08.prod.outlook.com (2603:10a6:800:1af::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:17:11 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::82f2:dba0:1f9b:c8f]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::82f2:dba0:1f9b:c8f%6]) with mapi id 15.20.6319.034; Tue, 25 Apr 2023 14:17:11 +0000 From: Tamar Christina To: Richard Biener CC: Richard Biener , "gcc-patches@gcc.gnu.org" , nd , "jlaw@ventanamicro.com" Subject: RE: [PATCH 2/3]middle-end match.pd: simplify debug dump checks Thread-Topic: [PATCH 2/3]middle-end match.pd: simplify debug dump checks Thread-Index: AQHZcd9aQj8zM/6Dz0CV1UH2aHtYkK8w4rkAgAsbvTCAAA1FAIAAESNg Date: Tue, 25 Apr 2023 14:17:11 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: DFFA5EC8F33BEE4ABCB8952A7EE6308C.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: VI1PR08MB5325:EE_|VE1PR08MB5744:EE_|AM7EUR03FT046:EE_|AS4PR08MB7555:EE_ X-MS-Office365-Filtering-Correlation-Id: bca8338c-4e02-4979-8a50-08db4597c9ed x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: CB/5ml2E1JtVcFF/cKtap4B00maOg2KtpCNw+5vDXDWTzwwzAvvz1Ujw0z1x4W7VA0WsTxyXZeiHrqhQptJxYLwkVZ4MZhnbLpRyTcjrgVxNB+KcItVx/MUqz3X+XFnnXbrzlTZL3cG9TP2M9vG7V75HM5vbLGWZHRdIN6WijC3jNI5KL4hcREWEP9wTmDMxlwGVHZq7u8sTm18+V3TP7k6+COeLZ65kP+v5m0yail5dSFYp/YY15BMS7wctVqJeW+KtlHNJy8daW8NVL/cGL/MwpPnb5142kB7yhSIopzwdFN0fPQx2qzQ3jfQOXAiUarYEDBoOXq+C5Asra14A+zedmlGWo+iAnEuE2kw+vu9JNCK4h6kKvrHmCYW90KkEuSum3Beyei+QW27Ma8VoTwaHO8YjAmTvn/qfRcKC+C33D1s9xBY/czpHh6rCinqIVmwIY/IQs7JyJxa/YC3QnoXoanzTi2H3VH80K3PLTxUNPcELlVOIWLBNsI2DNgze3OPmqz6V68vZQfQdrSsjCXBI8F92dH06tRd6NaqZK/gv/o2ltq9c7u2zF+amA0U8pws0rYNnGg5LgNZHof6KsgaRmZuC93p3KYfPH51m+/fOQiPoaPMM179dtFVe5pZ+ X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB5325.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199021)(38100700002)(122000001)(6506007)(9686003)(53546011)(26005)(55016003)(186003)(83380400001)(8936002)(33656002)(2906002)(30864003)(8676002)(52536014)(5660300002)(478600001)(54906003)(7696005)(38070700005)(316002)(71200400001)(4326008)(6916009)(66556008)(76116006)(64756008)(41300700001)(66446008)(66946007)(86362001)(66476007);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5744 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e05d8bdc-c058-48fb-68b0-08db4597c2cd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mXauJOF8GljlU8+vTn4L4ug/wpnprJoooubZGfQs0poh8TN8GajgQaO8BujgLuZQFhWaF1NlmGtoz9l4xdrMHxrI/CR8DDVVXHe6fNQ4TX6yAF1cGlUoTL+lq6Ti5l3EIVEL4E+qmKNjcn8nJ1yPbq+i/nHBZoa8V7g9ZosbqvGQunNWyX6HZu0jRgoOlPXg/kxp9x2ZH7oWmcABatNHKPHKwJMzTLvSSIhXHQRUHjymKaoplC0qOxJUQu7UnrscqtgkixNZA2Fej5bb1NodJlZNMuj89F9WGuIX8QQ0pZhYXwSdWTPHfVWInnYqfWppsnUZyArqpYbutOlw4anGR3dqzLZCqyQr/JhWVd40dYwaP3DPIH1e2xurBV53fAwFfAWyJ34Qz1OsODuSTxY5k2SFYS772VaH0SQIByVMJ4wDi5pVEk06STy7M3Jy+t41FDGi1Bznku7ZUO9+Ol5Aw4DdjguuXRRcJdwUU63I61IPeowgVJ6P7k/Dioc1/LaiIO+6yRkV5danhofUd3bVfNO0nLNF+kjjd7FfHGPlHiv7niERuoK3boDq2xsPzv+04SbVYodhP54TQBqSuBClFZrp4f0paiZNo83epTQge9PCq1ifT1cD0Zi4oKFBu2Qlzo0KKxtoDhQCMmP6Vn9OU4ob+ib7OJm6CgLxgZzOL+b+0ynKzb1HIOX3QQVWqCcobkptZQh4A7vrTLb/65Hq8A== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199021)(36840700001)(40470700004)(46966006)(30864003)(2906002)(70206006)(70586007)(4326008)(316002)(6862004)(52536014)(5660300002)(8936002)(8676002)(41300700001)(33656002)(82310400005)(86362001)(55016003)(40460700003)(40480700001)(356005)(186003)(26005)(9686003)(107886003)(53546011)(81166007)(478600001)(36860700001)(7696005)(83380400001)(47076005)(336012)(6506007)(54906003)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2023 14:17:23.2442 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bca8338c-4e02-4979-8a50-08db4597c9ed X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7555 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,KAM_DMARC_NONE,KAM_LOTSOFHASH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > -----Original Message----- > From: Richard Biener > Sent: Tuesday, April 25, 2023 2:14 PM > To: Tamar Christina > Cc: Richard Biener ; gcc-patches@gcc.gnu.org; > nd ; jlaw@ventanamicro.com > Subject: RE: [PATCH 2/3]middle-end match.pd: simplify debug dump checks >=20 > On Tue, 25 Apr 2023, Tamar Christina wrote: >=20 > > > -----Original Message----- > > > From: Richard Biener > > > Sent: Tuesday, April 18, 2023 11:48 AM > > > To: Tamar Christina > > > Cc: gcc-patches@gcc.gnu.org; nd ; rguenther@suse.de; > > > jlaw@ventanamicro.com > > > Subject: Re: [PATCH 2/3]middle-end match.pd: simplify debug dump > > > checks > > > > > > On Tue, Apr 18, 2023 at 12:22?PM Tamar Christina via Gcc-patches > > > wrote: > > > > > > > > Hi All, > > > > > > > > This is a small improvement in QoL codegen for match.pd to save > > > > time not re-evaluating the condition for printing debug > > > > information in every > > > function. > > > > > > > > There is a small but consistent runtime and compile time win here. > > > > The runtime win comes from not having to do the condition over > > > > again, and on Arm plaforms we now use the new test-and-branch > > > > support for booleans to only have a single instruction here. > > > > > > > > Compile time win is gotten from not having to do all the string > > > > parsing for the printf and having less string interning to do. > > > > > > > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > > > > > > > Ok for master? > > > > > > Ugh, I don't like the new global very much. Can't we compute it in > > > the toplevel entry and pass it down as parameter? Like passing down > > > the actual dump FILE *? > > > > So the dumpfile itself is currently also a global, I did try wiring > > this down, but the problem here is that eventually at the very top > > level, I need to modify the gimple_simplify calls because of the overlo= ads > being created by the output, which also need the parameter. > > > > There things become interesting because this then conflicts with the > > definitions in gimple-fold which would also need to take an additional > argument and it breaks the public API. > > > > Wiring the dbg value through all the generated and public function > > requires quite a lot of changes so I'm not sure this is worth it in tha= t case. > Should I just drop it? >=20 > Yeah, just drop it then. Btw, I wasn't suggesting to pass it down from t= he > actual API but compute it once (locally) at the toplevel entries in the g= enerated > gimple-match.cc and pass it down from there. So we'd retain one > (unconditionally done ...) >=20 > FILE *local_dump_file =3D (dump_flags & TDF_folding) ? dump_file : NULL= ; >=20 > and pass that down to functions called. Oohhhh apologies, that makes much more sense! I could have indeed stopped a= t gimple-match.cc and compute there. Fair enough. Let me make the change. Thanks!, Tamar >=20 > Richard. >=20 >=20 > > Thanks, > > Tamar > > > > > > > > The file output in output_line_directive was because we originally > > > had match.pd #includeing multiple match-*.pd files, we'd want to > > > keep that supported I think. But since the line directives are > > > commented and there's the same info available below, like > > > > > > /* #line 798 "/home/rguenther/src/gcc-13-branch/gcc/match.pd" */ > > > tree captures[2] ATTRIBUTE_UNUSED =3D { _p0= , _p1 }; > > > if (UNLIKELY (dump_file && (dump_flags & > > > TDF_FOLDING))) fprintf (dump_file, "Matching expression %s:%d, > > > %s:%d\n", "match.pd", 798, __FILE__, __LINE__); > > > > > > there's probably no point in emitting them anymore (originally I > > > emitted them non-commented but that didn't improve debugging much). > > > We might want to emit more "proper" line directives for the natively > > > copied parts of match.pd when code-generating c_expr parts, but that > would be something separate. > > > > > > Can you split the patch into two things? A patch removing output of > > > the commented line directives at the call sites is OK. > > > > > > Richard. > > > > > > > Thanks, > > > > Tamar > > > > > > > > gcc/ChangeLog: > > > > > > > > PR bootstrap/84402 > > > > * dumpfile.h (dump_folding_p): New. > > > > * dumpfile.cc (set_dump_file): Use it. > > > > * generic-match-head.cc (dump_debug): New. > > > > * gimple-match-head.cc (dump_debug): New. > > > > * genmatch.cc (output_line_directive): Support outputting = only line > > > > because file is implied. > > > > (dt_simplify::gen_1): Call debug_dump instead of printf. > > > > > > > > --- inline copy of patch -- > > > > diff --git a/gcc/dumpfile.h b/gcc/dumpfile.h index > > > > > > > > 7d5eca899dcc98676a9ce7a7efff8e439854ff89..e7b595ddecdcca9983d958 > > > 4b8b24 > > > > 17ae1941c7d4 100644 > > > > --- a/gcc/dumpfile.h > > > > +++ b/gcc/dumpfile.h > > > > @@ -522,6 +522,7 @@ parse_dump_option (const char *, const char > > > > **); extern FILE *dump_file; extern dump_flags_t dump_flags; > > > > extern const char *dump_file_name; > > > > +extern bool dump_folding_p; > > > > > > > > extern bool dumps_are_enabled; > > > > > > > > diff --git a/gcc/dumpfile.cc b/gcc/dumpfile.cc index > > > > > > > > 51f68c8c6b40051ba3125c84298ee44ca52f5d17..f805aa73f3aa244d84714 > > > 9eec265 > > > > 05181ce4efe8 100644 > > > > --- a/gcc/dumpfile.cc > > > > +++ b/gcc/dumpfile.cc > > > > @@ -63,6 +63,7 @@ FILE *dump_file =3D NULL; const char > > > > *dump_file_name; dump_flags_t dump_flags; bool dumps_are_enabled > > > > =3D false; > > > > +bool dump_folding_p =3D false; > > > > > > > > > > > > /* Set global "dump_file" to NEW_DUMP_FILE, refreshing the > > > "dumps_are_enabled" > > > > @@ -73,6 +74,7 @@ set_dump_file (FILE *new_dump_file) { > > > > dumpfile_ensure_any_optinfo_are_flushed (); > > > > dump_file =3D new_dump_file; > > > > + dump_folding_p =3D dump_file && (dump_flags & TDF_FOLDING); > > > > dump_context::get ().refresh_dumps_are_enabled (); } > > > > > > > > diff --git a/gcc/generic-match-head.cc b/gcc/generic-match-head.cc > > > > index > > > > > > > > f011204c5be450663231bdece0596317b37f9f9b..16b8f9f3b61d3d5651a5 > > > a41a8c05 > > > > 52f50b55cc7c 100644 > > > > --- a/gcc/generic-match-head.cc > > > > +++ b/gcc/generic-match-head.cc > > > > @@ -102,3 +102,17 @@ optimize_successive_divisions_p (tree, tree) = { > > > > return false; > > > > } > > > > + > > > > +/* Helper method for debug printing to reducing string parsing > overhead. > > > Keep > > > > + in sync with version in gimple-match-head.cc. */ > > > > + > > > > +static > > > > +void dump_debug (bool simplify, int loc, const char *file, int > > > > +lineno) { > > > > + if (simplify) > > > > + fprintf (dump_file, "Applying pattern %s:%d, %s:%d\n", "match.= pd", > loc, > > > > + file, lineno); > > > > + else > > > > + fprintf (dump_file, "Matching expression %s:%d, %s:%d\n", > > > > +"match.pd", > > > loc, > > > > + file, lineno); > > > > +} > > > > \ No newline at end of file > > > > diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index > > > > > > > > 638606b2502f640e59527fc5a0b23fa3bedd0cee..bd7c6ff4a3fb89d456b022 > > > 42707f > > > > d823b737f20d 100644 > > > > --- a/gcc/genmatch.cc > > > > +++ b/gcc/genmatch.cc > > > > @@ -185,7 +185,8 @@ fprintf_indent (FILE *f, unsigned int indent, > > > > const char *format, ...) > > > > > > > > static void > > > > output_line_directive (FILE *f, location_t location, > > > > - bool dumpfile =3D false, bool fnargs =3D fal= se) > > > > + bool dumpfile =3D false, bool fnargs =3D fal= se, > > > > + bool loc_only =3D false) > > > > { > > > > const line_map_ordinary *map; > > > > linemap_resolve_location (line_table, location, > > > > LRK_SPELLING_LOCATION, &map); @@ -204,7 +205,9 @@ > > > output_line_directive (FILE *f, location_t location, > > > > else > > > > ++file; > > > > > > > > - if (fnargs) > > > > + if (loc_only) > > > > + fprintf (f, "%d", loc.line); > > > > + else if (fnargs) > > > > fprintf (f, "\"%s\", %d", file, loc.line); > > > > else > > > > fprintf (f, "%s:%d", file, loc.line); @@ -3431,14 +3434,11 > > > > @@ > > > > dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *resu= lt) > > > > needs_label =3D true; > > > > } > > > > > > > > - fprintf_indent (f, indent, "if (UNLIKELY (dump_file && > > > > (dump_flags & > > > TDF_FOLDING))) " > > > > - "fprintf (dump_file, \"%s ", > > > > - s->kind =3D=3D simplify::SIMPLIFY > > > > - ? "Applying pattern" : "Matching expression"); > > > > - fprintf (f, "%%s:%%d, %%s:%%d\\n\", "); > > > > + fprintf_indent (f, indent, "if (UNLIKELY (dump_folding_p)) " > > > > + "dump_debug (%s, ", s->kind =3D=3D simplify::SIMPLIFY ? "tr= ue" : > > > > + "false"); > > > > output_line_directive (f, > > > > result ? result->location : s->match->loca= tion, true, > > > > - true); > > > > + true, true); > > > > fprintf (f, ", __FILE__, __LINE__);\n"); > > > > > > > > fprintf_indent (f, indent, "{\n"); diff --git > > > > a/gcc/gimple-match-head.cc b/gcc/gimple-match-head.cc index > > > > > > > > ec603f9d043c3924ea442bb49b5300a3573503cf..ae0c5c8a74fd9f1acdb616 > > > 014941 > > > > b11961e96c04 100644 > > > > --- a/gcc/gimple-match-head.cc > > > > +++ b/gcc/gimple-match-head.cc > > > > @@ -1412,3 +1412,17 @@ get_conditional_internal_fn (code_helper > > > > code, > > > tree type) > > > > auto cfn =3D combined_fn (code); > > > > return get_conditional_internal_fn (associated_internal_fn > > > > (cfn, type)); } > > > > + > > > > +/* Helper method for debug printing to reducing string parsing > overhead. > > > Keep > > > > + in sync with version in generic-match-head.cc. */ > > > > + > > > > +static > > > > +void dump_debug (bool simplify, int loc, const char *file, int > > > > +lineno) { > > > > + if (simplify) > > > > + fprintf (dump_file, "Applying pattern %s:%d, %s:%d\n", "match.= pd", > loc, > > > > + file, lineno); > > > > + else > > > > + fprintf (dump_file, "Matching expression %s:%d, %s:%d\n", > > > > +"match.pd", > > > loc, > > > > + file, lineno); > > > > +} > > > > \ No newline at end of file > > > > > > > > > > > > > > > > > > > > -- > > >=20 > -- > Richard Biener > SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 > Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, > Boudien Moerman; HRB 36809 (AG Nuernberg)