From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2049.outbound.protection.outlook.com [40.107.13.49]) by sourceware.org (Postfix) with ESMTPS id 39DD73858D32 for ; Thu, 6 Apr 2023 10:56:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39DD73858D32 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=bAw3wdpLQ/jdqOcK3XFj1BLsKXeNwEKtOOthQXjCngg=; b=TrhUaZLUOnUGuL3VG9eEGzsOZcBQ9zi0OxXIpkAAz2ppREMSFLt6Hi/4Ti/8vciyFYNbCjJr6ctoyWA1EWNhlwy+6AzfCFP9zW8Hv8I1k3lCL3JoSSPIyVahcxGk0dau8Ay18XrwVj0ko2fokAa1qB8gOYckG91+QGAlwe65rkc= Received: from AS9PR06CA0095.eurprd06.prod.outlook.com (2603:10a6:20b:465::28) by AS8PR08MB8252.eurprd08.prod.outlook.com (2603:10a6:20b:53c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Thu, 6 Apr 2023 10:56:14 +0000 Received: from AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::a3) by AS9PR06CA0095.outlook.office365.com (2603:10a6:20b:465::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.22 via Frontend Transport; Thu, 6 Apr 2023 10:56:14 +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 AM7EUR03FT008.mail.protection.outlook.com (100.127.141.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.31 via Frontend Transport; Thu, 6 Apr 2023 10:56:13 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Thu, 06 Apr 2023 10:56:13 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4148cc679a5c71f1 X-CR-MTA-TID: 64aa7808 Received: from f1bbb2cd4ed3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 13B08E8D-34AA-4B75-AFDE-4EA97559267B.1; Thu, 06 Apr 2023 10:56:06 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f1bbb2cd4ed3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 06 Apr 2023 10:56:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eg1EpgOzHsyOHFeBIzQa19cFnn+kxycnfcV1TjFGpVsm7yUccWSSC94xfoVQTbDyF+EtdeprL4dq96HHx4GW79DyC2tFJlDJOPyjCIIuIxKZPNi7s3BKiEUMFvLllyos7aekJLiK0Jku4kQncaxBlMYtRED46QwPc80AshFfi0zTx54LQn69ckSEs1DIiMx1opia7nsQ6YyU+zm4+RFRqfsN/jfDUM80+6pv5OI/ez07nNcgmE/I/AXcWPnR3ELkicONjHX8+PNXRtGkTjVt+lyPewoU5Qjvm+zr1LahLI52PcRA+vVoZCrAGRWuut2jmR8L1anbxYNBh83/5AzgEA== 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=bAw3wdpLQ/jdqOcK3XFj1BLsKXeNwEKtOOthQXjCngg=; b=Uqx/VReR6QyvUZs/3thM795C4hbEl8+NCrC3/p4G2X6N3VZsWFQ8sOT8HNci9KtM0zP5YzRILoRsVOpHATUb1U63j+v/O++FfOxPaErV+bqQGXHdhZ8iWruAwLVLJJSCizq3lpd+Jp/nQLevONrVxRyf0N/TR9JChcCBhWiXcHAokt0KALxn2yCIDNj7sG5tiCybFfClzV3vfT8RkM5EKer9hSqxQZpnVWD8vCTf1CAxqP+5SkWJ8CUHl1xbQqP0i5aGSX5h7IuyqatVo/6S2tBeBTS4N2tztiE7dqEsH7Stvn50+JUy/W5LK96MdrQ7pNTIpyaygHxj9SXx/YQFkA== 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=bAw3wdpLQ/jdqOcK3XFj1BLsKXeNwEKtOOthQXjCngg=; b=TrhUaZLUOnUGuL3VG9eEGzsOZcBQ9zi0OxXIpkAAz2ppREMSFLt6Hi/4Ti/8vciyFYNbCjJr6ctoyWA1EWNhlwy+6AzfCFP9zW8Hv8I1k3lCL3JoSSPIyVahcxGk0dau8Ay18XrwVj0ko2fokAa1qB8gOYckG91+QGAlwe65rkc= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AM9PR08MB5876.eurprd08.prod.outlook.com (2603:10a6:20b:2d5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.29; Thu, 6 Apr 2023 10:56:03 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::73a3:ecc1:2c9c:3f71]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::73a3:ecc1:2c9c:3f71%4]) with mapi id 15.20.6254.035; Thu, 6 Apr 2023 10:56:03 +0000 Date: Thu, 6 Apr 2023 11:56:01 +0100 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com, mliska@suse.cz Subject: [PATCH 1/3] RFC match.pd: don't emit label if not needed Message-ID: Content-Type: multipart/mixed; boundary="a63jPxNlzbW5WUbI" Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0026.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::13) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AM9PR08MB5876:EE_|AM7EUR03FT008:EE_|AS8PR08MB8252:EE_ X-MS-Office365-Filtering-Correlation-Id: 923cc8b6-9cae-4060-6c06-08db368d8a2a 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: JCEkK340oUqRYRQEmYNNBLQlk1dfNsz80n1z4TsxMqtA6kLBIUb2wVTJzc+fYWfxxzzXlslAqXaRU75jdqcAWvJggfspRunI38Gxk52UAVvftNPjeO7Ow14dVton9tX1MnhheykPZra66yWZSlNchDqHYmlHnGeVLR2tCSTw61B8KJGA+m3emW8v332K/3AnaUDKfj2oQFC8cJ9P20ZhfROw4PvUUX35J5IM2USkCAnrvD3BmsC0UNSNRVSWM6+CvzPpk9o1jnhx92diYP6FC2ln/Pvxamoowj8IzdRoKP/bP80Wypbe1KdKeYkvIV8pKb0tCQCLWEqUd8J/TYTQR8yPVfs1B0hRIarLOF8DH4LyuNOMBNtD0ekbzCBBjhlv24mn0j7rPYjGV/pJcNE8hjXb+f3WTMzTp5DVkiK22A7Rdvxc4bsm72Ugeey19dDVKK+Dz6fhnNwP3PYRGNii0LV1vTnsi0l79H4hC0R+PH2MqRmLd+Rp/l95UP+4RP0yQfWLxYH0d9Eawcg+2BotycGqSotarFl7qlR94THlwq8apOf+KgbmmrDljOS/DIrdi2s5wInW8wlURunADdgojUxRf7wXgIbA+U5ItFxIbXMY85JdJKo5sJClcgxB1zATMy2z50eLX9JomYiFnlGyvA== 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)(366004)(39860400002)(346002)(396003)(376002)(136003)(451199021)(38100700002)(4326008)(235185007)(8676002)(8936002)(6916009)(5660300002)(66476007)(66946007)(66556008)(41300700001)(86362001)(36756003)(44832011)(6486002)(2906002)(478600001)(83380400001)(316002)(2616005)(6512007)(44144004)(33964004)(4743002)(186003)(26005)(6506007)(4216001)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5876 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: AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 00148d68-4807-43dc-8107-08db368d83e6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b/QjeBAv/5USuePXorjIIYzxyg4+hY4tGYK5HATrPeTeMNCtinFT+orIxiZsLSbwpC8euneyR6W9Ztsm6/RagqxXfVsS9Jwgj6w68BEgfnAilbItj/p9ZkGBHcsVq60usnhk4dVzJ9F3rdyGVXI8lYjr26nz16wglRGFhcM2F1RCOx6wMWxyEN89RKy0Z0mxM4MT9neOnRrkfdtM62fbwGT+MH23q2BY66eBoMidA2hBATCZYjhz8EdZzhG6Hu6GFVn+SH0QgozsdQL/5VyWIzlVboeErWSpLlI8S7D1S1lIoRgxDsXzKxWpP3ajeIhlzQvQX8Inr/+aOBXe32U7LqBVYMaVX6ytihQsggxbFSAQneQ/slGft4KAm6zWA8nTBtLsss+U+2VmECTsEHOC8lXpN/NfDZWKv/DXKwe1R43QCkfgKw6VwzQxaJxQnmdezMLjkSldcVh/c+g0MquUzpGTGVFDOY8uvJRks1qPA+doIK/5p0RX3sZwxkNTOlmq3oYLdQW06lavBtwGwj542Qhidg4u94K56e46vW10ofUAGavkUraq+TYtOCg6SsPqJasxfu4McICYI5pruRn2fBU4d5+9oRRsHDaF+pFM2grzd8OY4XSCcJ2ThLP4XaoTYXPiyBjm/ACF/BBTCekdX4H7VoMcvRlbenTqDTZClLw1uvb8VAHioCCkHjxn6wxk/2TEoGD77VsEVNrP+5pHTMkfuPNirmYx7rEfe0M/2InXsmbPedTfRy5h1sNGoHpX 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)(396003)(376002)(39860400002)(136003)(346002)(451199021)(40470700004)(36840700001)(46966006)(235185007)(316002)(5660300002)(41300700001)(8936002)(4326008)(186003)(4743002)(2906002)(8676002)(478600001)(70586007)(70206006)(6916009)(44832011)(107886003)(6486002)(81166007)(40460700003)(6506007)(26005)(33964004)(44144004)(47076005)(6512007)(40480700001)(83380400001)(356005)(36860700001)(36756003)(336012)(2616005)(82740400003)(82310400005)(86362001)(4216001)(2700100001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2023 10:56:13.8444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 923cc8b6-9cae-4060-6c06-08db368d8a2a 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: AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8252 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,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: --a63jPxNlzbW5WUbI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi All, Just sending these so people can test the series. This is a small QoL codegen improvement for match.pd to not emit labels when they are not needed. The codegen is nice and there is a small (but consistent) improvement in compile time. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for GCC 14? Thanks, Tamar gcc/ChangeLog: PR bootstrap/84402 * genmatch.cc (dt_simplify::gen_1): Only emit labels if used. --- inline copy of patch -- diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index 4fab4135347c43d95546a7df0bb1c4d074937288..638606b2502f640e59527fc5a0b23fa3bedd0cee 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) char local_fail_label[256]; snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt); fail_label = local_fail_label; + bool needs_label = false; /* Analyze captures and perform early-outs on the incoming arguments that cover cases we cannot handle. */ @@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (as_a (s->match)->ops[i]->location, "forcing toplevel operand to have no " @@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (captures[%d])) " "goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (cinfo.info[i].c->location, "forcing captured operand to have no " @@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } if (s->kind == simplify::SIMPLIFY) - fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + { + fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + needs_label = true; + } fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " "fprintf (dump_file, \"%s ", @@ -3496,9 +3502,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) "res_op->resimplify (%s, valueize);\n", !e->force_leaf ? "lseq" : "NULL"); if (e->force_leaf) - fprintf_indent (f, indent, - "if (!maybe_push_res_to_seq (res_op, NULL)) " - "goto %s;\n", fail_label); + { + fprintf_indent (f, indent, + "if (!maybe_push_res_to_seq (res_op, NULL)) " + "goto %s;\n", fail_label); + needs_label = true; + } } } else if (result->type == operand::OP_CAPTURE @@ -3554,9 +3563,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) continue; if (cinfo.info[i].result_use_count > cinfo.info[i].match_use_count) - fprintf_indent (f, indent, - "if (! tree_invariant_p (captures[%d])) " - "goto %s;\n", i, fail_label); + { + fprintf_indent (f, indent, + "if (! tree_invariant_p (captures[%d])) " + "goto %s;\n", i, fail_label); + needs_label = true; + } } for (unsigned j = 0; j < e->ops.length (); ++j) { @@ -3607,6 +3619,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) { fprintf_indent (f, indent, "if (!_r)\n"); fprintf_indent (f, indent, " goto %s;\n", fail_label); + needs_label = true; } } } @@ -3647,7 +3660,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } indent -= 2; fprintf_indent (f, indent, "}\n"); - fprintf (f, "%s:;\n", fail_label); + if (needs_label) + fprintf (f, "%s:;\n", fail_label); fail_label = NULL; } -- --a63jPxNlzbW5WUbI Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="rb17157.patch" diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index 4fab4135347c43d95546a7df0bb1c4d074937288..638606b2502f640e59527fc5a0b23fa3bedd0cee 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) char local_fail_label[256]; snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt); fail_label = local_fail_label; + bool needs_label = false; /* Analyze captures and perform early-outs on the incoming arguments that cover cases we cannot handle. */ @@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (as_a (s->match)->ops[i]->location, "forcing toplevel operand to have no " @@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (captures[%d])) " "goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (cinfo.info[i].c->location, "forcing captured operand to have no " @@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } if (s->kind == simplify::SIMPLIFY) - fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + { + fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + needs_label = true; + } fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " "fprintf (dump_file, \"%s ", @@ -3496,9 +3502,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) "res_op->resimplify (%s, valueize);\n", !e->force_leaf ? "lseq" : "NULL"); if (e->force_leaf) - fprintf_indent (f, indent, - "if (!maybe_push_res_to_seq (res_op, NULL)) " - "goto %s;\n", fail_label); + { + fprintf_indent (f, indent, + "if (!maybe_push_res_to_seq (res_op, NULL)) " + "goto %s;\n", fail_label); + needs_label = true; + } } } else if (result->type == operand::OP_CAPTURE @@ -3554,9 +3563,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) continue; if (cinfo.info[i].result_use_count > cinfo.info[i].match_use_count) - fprintf_indent (f, indent, - "if (! tree_invariant_p (captures[%d])) " - "goto %s;\n", i, fail_label); + { + fprintf_indent (f, indent, + "if (! tree_invariant_p (captures[%d])) " + "goto %s;\n", i, fail_label); + needs_label = true; + } } for (unsigned j = 0; j < e->ops.length (); ++j) { @@ -3607,6 +3619,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) { fprintf_indent (f, indent, "if (!_r)\n"); fprintf_indent (f, indent, " goto %s;\n", fail_label); + needs_label = true; } } } @@ -3647,7 +3660,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } indent -= 2; fprintf_indent (f, indent, "}\n"); - fprintf (f, "%s:;\n", fail_label); + if (needs_label) + fprintf (f, "%s:;\n", fail_label); fail_label = NULL; } --a63jPxNlzbW5WUbI-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2069.outbound.protection.outlook.com [40.107.22.69]) by sourceware.org (Postfix) with ESMTPS id 9B1F03858C5F for ; Tue, 18 Apr 2023 10:20:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B1F03858C5F 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=imKjXp8FB2Ev9XETR7yEYKpHHgaqdx27fj+i6LTMb5Q=; b=JW9k08n+5lHomOh4gbNYJr5re8lsBw/DBrOfnYXwkQtO8suzPbbj63Av1OCdgWMJf8Fj/i0hATcbZuEHOJ+xdoDL7TSfrAsZSETNfR+19XMz7NEFt6BXbZR3QiOz7eMU9gVa4d0VGsEWven+pO0EMk3S25CbtMrILI/+Y2dgECw= Received: from DB8PR03CA0031.eurprd03.prod.outlook.com (2603:10a6:10:be::44) by AM8PR08MB5682.eurprd08.prod.outlook.com (2603:10a6:20b:1c5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 10:19:58 +0000 Received: from DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:be:cafe::45) by DB8PR03CA0031.outlook.office365.com (2603:10a6:10:be::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.47 via Frontend Transport; Tue, 18 Apr 2023 10:19:57 +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 DBAEUR03FT009.mail.protection.outlook.com (100.127.143.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20 via Frontend Transport; Tue, 18 Apr 2023 10:19:57 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Tue, 18 Apr 2023 10:19:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4148cc679a5c71f1 X-CR-MTA-TID: 64aa7808 Received: from 9ce1929f7b6d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F0A153A3-4269-4AE1-A2D9-E9B1B0F1D855.1; Tue, 18 Apr 2023 10:19:51 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9ce1929f7b6d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 18 Apr 2023 10:19:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U7Hhr3fsqdMx2myVmsgxUZcFPwQxt0vgr2jn7qyC98fF1vveIZk/T4jmzvHBRiFOMP9qRZTk+/X2gOZli086+njZaOYbJ7nb6MjYsJXpJndsUMVtVfHTZZrPnQevgElluSNogWosl0Fl8SBZaEEHx5gAB9yFanjjrr18tfJ/yJBvD/Ie4UTvNmqDxJMIKOyb1YAMMUUKubbNXyq5OcsmMfpYabSReWlvsLmkq6bZi1VWkIiv8q4/NHi6Gr/qTAcMirUeR5lsvVAKotcYsdnsnveIkfKhXIV4TXPx+hUdFxgDlUB0vY79Q9cXgHGn5nVIKHRYfci3jskSkAFVG48ciA== 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=imKjXp8FB2Ev9XETR7yEYKpHHgaqdx27fj+i6LTMb5Q=; b=Rywqw8Qmeqna/nXEiH/dyjgjmmk3Neo8m0vTjltNDZIx1osCJAFevJWAsXRJwL75ErhRegadVZnalzUWdaeQvDBA8fChOD61csjH6FnO19ldGo/0J8zaMWARp2AogYfP9q6Zjj8eLdBif1sQbpvW17WUBsRFcA+FBhJWfS2InPwRXYnLi5wUUpWQ+xFMo6aa9ObQSWO6MvJMMMEW7EN3i247aMNS7lXMcIZvmHOa62Av+Fr5CuVc92xrO02RI3vG/jAaLnZR13cCUJD1XdOQ5AZastmnpwto1iv3pczmp+1JG3cNwMZU+qrNmOTCId4B0p3UltWlA2HPMGe0qvPi4Q== 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=imKjXp8FB2Ev9XETR7yEYKpHHgaqdx27fj+i6LTMb5Q=; b=JW9k08n+5lHomOh4gbNYJr5re8lsBw/DBrOfnYXwkQtO8suzPbbj63Av1OCdgWMJf8Fj/i0hATcbZuEHOJ+xdoDL7TSfrAsZSETNfR+19XMz7NEFt6BXbZR3QiOz7eMU9gVa4d0VGsEWven+pO0EMk3S25CbtMrILI/+Y2dgECw= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by DBAPR08MB5765.eurprd08.prod.outlook.com (2603:10a6:10:1ac::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 10:19:47 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::73a3:ecc1:2c9c:3f71]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::73a3:ecc1:2c9c:3f71%4]) with mapi id 15.20.6298.045; Tue, 18 Apr 2023 10:19:47 +0000 Date: Tue, 18 Apr 2023 11:19:38 +0100 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH 1/3]middle-end match.pd: don't emit label if not needed Message-ID: Content-Type: multipart/mixed; boundary="WVUlxC66IGfyteO9" Content-Disposition: inline X-ClientProxiedBy: SA1PR05CA0014.namprd05.prod.outlook.com (2603:10b6:806:2d2::23) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|DBAPR08MB5765:EE_|DBAEUR03FT009:EE_|AM8PR08MB5682:EE_ X-MS-Office365-Filtering-Correlation-Id: bc623798-71c6-4622-e867-08db3ff67599 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: l7jW8MaCT/AfnOLfntNs0RtWyeE3ZwcS7LY4dRssmGg5oPboTRWRx4LE+ddsFCEfnVH1ekNoASjj41m3aerWIiV6GyHZANGXhXphn4u0uYGrqvCOnpYz7/JcfpAzZ0j6G6ptc6m8ZJpr0/eq2+ZyRWbnGUGm/WtTtj44pesC/IgT/J81HOpKlkYxFmD+B1oCLEUg0rT5gvHF53Bj6cgkQ9GlfzpiMtRZIS9YOFZYp8w+Z1oSgixUkckGRU4kY3KaMYSaLFGdeDnBlM09NybxkmYHVhoUUOnItO8yn7S9hyCHVBDUEf7vX02+Bh6675KDkbRJVh2oylv8wJyZQLSJGxXL3FqFLnor9a0iPjDe4SIx+qxM+NwjP8GIreXq/aGvyN2pyfY9UTjk8hmBeoKkxxcfyu4/0BKE8gLUbj0vmMYWQV300acR/ncOftF/vVElghkLJg9ITuv9V+Lp7STHMGWZD0bo9y2DS/Rhye740zf3Sosc40nWRuq4vmjUCFyCAPmS8ksKAPcN5vJNpVpAGhk6uUV91IB/eY8NnT8eNd1yzIrHPB6nKIlgXbMjie2LbREiLyidY+rl6aok8U5+zX2t6JVv08qdyFgsmfJ+GZrwQ6Tq9rrd3qRlob6vpaJx8v3cgjvKwaoj3Cy0H5hbvw== 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)(346002)(136003)(366004)(376002)(396003)(39850400004)(451199021)(36756003)(38100700002)(8936002)(8676002)(44832011)(235185007)(5660300002)(2906002)(86362001)(478600001)(6486002)(44144004)(6666004)(33964004)(4743002)(186003)(2616005)(6512007)(66946007)(6506007)(66476007)(26005)(41300700001)(316002)(83380400001)(6916009)(4326008)(66556008)(4216001)(2700100001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5765 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: DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: af8f0d94-e85d-4fb6-c9a9-08db3ff66f75 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bymBe49j8BHfsVHFd4dAdmWl57HFNNA6Ru0q4saSnRMlEpFTlUisAB7YngW9SKrNLa9JdpKeHX56D9shlhNOZu7qIDSa55ufFw6Srgl+cDPqToDAtlNH4P7khhpfxdMmUMkzC6MeuGeo6kjKW6m+L0Q2X7p/NKGK2zDzv2zGqGodLHMJWa12MxlNXWQWXAQMhZa9xBVv2KtYCrUdoU0G9FjtK1JRa4/MbZqNzF1ZK1ik1lzZsTNp53VsAIw0wifhG7k0ZLWLJgya53a+7C5sI08Ezok2KtMeBNb7FIhZRhn7u/A2lD96WPBZWah0TR95Il0S7tidbjjHCWmQngbbm4ayT9TE5TH0C6D2MkMWlrgv2BB8BCq0GqKy6cl7xXxRdMJvbP5Ql01NOcvAskyDa+WDeE0uqw4u9HFWCMvoOP/PW0XjPT6r3yLVMA0qO5jTkp7peIZapAVCsFz1pqtJxbqdhqSFIkOTVPsgA/NkimQMDVU+uoUD+xUiJjrCimyAsonTX2KHwlNDTgnkGaWxjwDMFzzQnLSSUT/CuWpewUiIxlb4CqUHxCANoW+GHZL5uL9+PgjZfj+ydpVahatlsyKpZL1tuHW//M7iEzbBwM1uA1HXgQ/gmuDh/hjwLOyopSHLKZPtFtCaSGURR9Ugu5RY9LPcKQTtBxygY/Xhmh2VO7MiLQcZZkfjI/UEq5FS8nDfjf1cMjtNU97Y4PzNzQE2NozQtvA8pejqFqAUaGAoP7mNOEKUhnZBBW+avEHq 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)(346002)(136003)(376002)(39860400002)(396003)(451199021)(36840700001)(40470700004)(46966006)(36756003)(8936002)(8676002)(40460700003)(44832011)(235185007)(5660300002)(2906002)(82310400005)(86362001)(40480700001)(478600001)(6486002)(44144004)(6666004)(33964004)(4743002)(186003)(107886003)(2616005)(36860700001)(6512007)(6506007)(70586007)(70206006)(26005)(41300700001)(356005)(82740400003)(316002)(83380400001)(81166007)(6916009)(4326008)(47076005)(336012)(4216001)(2700100001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 10:19:57.0426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc623798-71c6-4622-e867-08db3ff67599 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: DBAEUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5682 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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: Message-ID: <20230418101938.88K5zYUXcff9kFDLhu4oipWzEqR9_jvshwzdh9XLStA@z> --WVUlxC66IGfyteO9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi All, This is a small QoL codegen improvement for match.pd to not emit labels when they are not needed. The codegen is nice and there is a small (but consistent) improvement in compile time. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR bootstrap/84402 * genmatch.cc (dt_simplify::gen_1): Only emit labels if used. --- inline copy of patch -- diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index 4fab4135347c43d95546a7df0bb1c4d074937288..638606b2502f640e59527fc5a0b23fa3bedd0cee 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) char local_fail_label[256]; snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt); fail_label = local_fail_label; + bool needs_label = false; /* Analyze captures and perform early-outs on the incoming arguments that cover cases we cannot handle. */ @@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (as_a (s->match)->ops[i]->location, "forcing toplevel operand to have no " @@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (captures[%d])) " "goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (cinfo.info[i].c->location, "forcing captured operand to have no " @@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } if (s->kind == simplify::SIMPLIFY) - fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + { + fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + needs_label = true; + } fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " "fprintf (dump_file, \"%s ", @@ -3496,9 +3502,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) "res_op->resimplify (%s, valueize);\n", !e->force_leaf ? "lseq" : "NULL"); if (e->force_leaf) - fprintf_indent (f, indent, - "if (!maybe_push_res_to_seq (res_op, NULL)) " - "goto %s;\n", fail_label); + { + fprintf_indent (f, indent, + "if (!maybe_push_res_to_seq (res_op, NULL)) " + "goto %s;\n", fail_label); + needs_label = true; + } } } else if (result->type == operand::OP_CAPTURE @@ -3554,9 +3563,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) continue; if (cinfo.info[i].result_use_count > cinfo.info[i].match_use_count) - fprintf_indent (f, indent, - "if (! tree_invariant_p (captures[%d])) " - "goto %s;\n", i, fail_label); + { + fprintf_indent (f, indent, + "if (! tree_invariant_p (captures[%d])) " + "goto %s;\n", i, fail_label); + needs_label = true; + } } for (unsigned j = 0; j < e->ops.length (); ++j) { @@ -3607,6 +3619,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) { fprintf_indent (f, indent, "if (!_r)\n"); fprintf_indent (f, indent, " goto %s;\n", fail_label); + needs_label = true; } } } @@ -3647,7 +3660,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } indent -= 2; fprintf_indent (f, indent, "}\n"); - fprintf (f, "%s:;\n", fail_label); + if (needs_label) + fprintf (f, "%s:;\n", fail_label); fail_label = NULL; } -- --WVUlxC66IGfyteO9 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="rb17157.patch" diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc index 4fab4135347c43d95546a7df0bb1c4d074937288..638606b2502f640e59527fc5a0b23fa3bedd0cee 100644 --- a/gcc/genmatch.cc +++ b/gcc/genmatch.cc @@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) char local_fail_label[256]; snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt); fail_label = local_fail_label; + bool needs_label = false; /* Analyze captures and perform early-outs on the incoming arguments that cover cases we cannot handle. */ @@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (as_a (s->match)->ops[i]->location, "forcing toplevel operand to have no " @@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) fprintf_indent (f, indent, "if (TREE_SIDE_EFFECTS (captures[%d])) " "goto %s;\n", i, fail_label); + needs_label = true; if (verbose >= 1) warning_at (cinfo.info[i].c->location, "forcing captured operand to have no " @@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } if (s->kind == simplify::SIMPLIFY) - fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + { + fprintf_indent (f, indent, "if (UNLIKELY (!dbg_cnt (match))) goto %s;\n", fail_label); + needs_label = true; + } fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & TDF_FOLDING))) " "fprintf (dump_file, \"%s ", @@ -3496,9 +3502,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) "res_op->resimplify (%s, valueize);\n", !e->force_leaf ? "lseq" : "NULL"); if (e->force_leaf) - fprintf_indent (f, indent, - "if (!maybe_push_res_to_seq (res_op, NULL)) " - "goto %s;\n", fail_label); + { + fprintf_indent (f, indent, + "if (!maybe_push_res_to_seq (res_op, NULL)) " + "goto %s;\n", fail_label); + needs_label = true; + } } } else if (result->type == operand::OP_CAPTURE @@ -3554,9 +3563,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) continue; if (cinfo.info[i].result_use_count > cinfo.info[i].match_use_count) - fprintf_indent (f, indent, - "if (! tree_invariant_p (captures[%d])) " - "goto %s;\n", i, fail_label); + { + fprintf_indent (f, indent, + "if (! tree_invariant_p (captures[%d])) " + "goto %s;\n", i, fail_label); + needs_label = true; + } } for (unsigned j = 0; j < e->ops.length (); ++j) { @@ -3607,6 +3619,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) { fprintf_indent (f, indent, "if (!_r)\n"); fprintf_indent (f, indent, " goto %s;\n", fail_label); + needs_label = true; } } } @@ -3647,7 +3660,8 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, operand *result) } indent -= 2; fprintf_indent (f, indent, "}\n"); - fprintf (f, "%s:;\n", fail_label); + if (needs_label) + fprintf (f, "%s:;\n", fail_label); fail_label = NULL; } --WVUlxC66IGfyteO9--