From patchwork Wed Apr 19 12:13:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 85360 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp339569vqo; Wed, 19 Apr 2023 05:14:39 -0700 (PDT) X-Google-Smtp-Source: AKy350adXe6iQlb6XgH7Yb1NoaUwPv8kfwyA2bYg3CjdDHFTzTlmVkdYoEiK51g/bS99Zvjbn3Nb X-Received: by 2002:a05:6402:16:b0:4fa:3b3:c867 with SMTP id d22-20020a056402001600b004fa03b3c867mr5735886edu.17.1681906479061; Wed, 19 Apr 2023 05:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681906479; cv=none; d=google.com; s=arc-20160816; b=BTW4LZOdGQgnMQMqGjXUVpP64UFSMxZFhBcQ1Kg0xUENOGvod0AKaGWvcNxT/KNp1v O/AmzpeMW4/uFbzDpJj3DUDeYY4E4Q57nq1oXni4L9jsCyYl2rI94z9BTIyoK1m8gzPM v7rWBoCpVFEBVtQ+Rxopf6NpGGtULJY+4PPS5QH06Xtxi88rbWpIJTt9miU7SSV8uj/T S7/6Jxx6rl8oS21xs3VTbpnL319KYzRN6TmRzGkYaTulfIYnqcxCDICWLmHbG8vfeOUl HlqPD/I7h31dXlTJBUngT1BhC2X9kbcgC1NQh3UjTLTbnRHmf+nhN1M/Iy1RHvLeyZV2 Wcig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:sender:errors-to:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=vvRT9XlJOIdl5HxyRrIm6Un4icqIdvtmuBTen9eG71M=; b=bC3Khr9oLdD52g6GVPzsQc886m2A3FSSJkI0iz2aLaY6W3ymr6beE318L0hoNukNvS c/DfJBQ8nQTw4MBYFLtZNkxiqnADwOnf5ZatEVfp8EBLknPaH9M/kE349VBwb0a3dclN +X+ASFlCZVrhsTYk7Zdi4zWVS3U9EdyobYhBEcyndxmgsFE0MHWasejGL1ZQwy+6NvlU 9YCe/se1OMJR9CTnBGj/YsOlvB2zJslE6cMUhtl7IxoHmmv3FFmNyYfDa3iYiPvAaXYL RHdXC744X+f+KCj9BnPJnZb5aYMZPROcvG2QlFqxaay60CNCzEcpl4trGNkzr5fCWru2 mt/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kymQbyot; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q28-20020a056402033c00b00505e03b9c17si13769709edw.252.2023.04.19.05.14.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 05:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=kymQbyot; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87B213856DF6 for ; Wed, 19 Apr 2023 12:14:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87B213856DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681906464; bh=vvRT9XlJOIdl5HxyRrIm6Un4icqIdvtmuBTen9eG71M=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=kymQbyot4J1DfJwvl0VcratvZL5hJI7hq9gVRS7r5VA+sk0vRfsCD8nrNrhc1rpcr 7ZGsyHXF3t8UrEaFrh0EXJy+HrsNNUOpgb/lJbE/sXr6dAemrbS67LkHO4joprloT+ jLYhZ/oUXip0IkKiAiclrXA04yHpfx+/fqCv3JvM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id F08503858D39 for ; Wed, 19 Apr 2023 12:13:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F08503858D39 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 17BC91FD8A for ; Wed, 19 Apr 2023 12:13:39 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0D9D42C141 for ; Wed, 19 Apr 2023 12:13:39 +0000 (UTC) Date: Wed, 19 Apr 2023 12:13:38 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Remove odd code from gimple_can_merge_blocks_p User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" Message-Id: <20230419121424.87B213856DF6@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763606768067404882?= X-GMAIL-MSGID: =?utf-8?q?1763606768067404882?= The following removes a special case to not merge a block with only a non-local label. We have a restriction of non-local labels to be the first statement (and label) in a block, but otherwise nothing, if the last stmt of A is a non-local label then it will be still the first statement of the combined A + B. In particular we'd happily merge when there's a stmt after that label. The check originates from the tree-ssa merge. Bootstrapped and tested on x86_64-unknown-linux-gnu with all languages. Will push later. * tree-cfg.cc (gimple_can_merge_blocks_p): Remove condition rejecting the merge when A contains only a non-local label. --- gcc/tree-cfg.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index a9fcc7fd050..ae53e15158a 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -1960,12 +1960,6 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b) if (stmt && stmt_ends_bb_p (stmt)) return false; - /* Do not allow a block with only a non-local label to be merged. */ - if (stmt) - if (glabel *label_stmt = dyn_cast (stmt)) - if (DECL_NONLOCAL (gimple_label_label (label_stmt))) - return false; - /* Examine the labels at the beginning of B. */ for (gimple_stmt_iterator gsi = gsi_start_bb (b); !gsi_end_p (gsi); gsi_next (&gsi))