From patchwork Wed Apr 19 10:32:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 85309 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp279003vqo; Wed, 19 Apr 2023 03:33:35 -0700 (PDT) X-Google-Smtp-Source: AKy350YnV654VLp9ArWEgrYHusWZ1ZjdbJNjnQLl4jeNS3cHJrB4M1A+/QCfENRQQl3n1YaNcqYj X-Received: by 2002:aa7:ca45:0:b0:504:9346:11d3 with SMTP id j5-20020aa7ca45000000b00504934611d3mr6158588edt.29.1681900415528; Wed, 19 Apr 2023 03:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681900415; cv=none; d=google.com; s=arc-20160816; b=cBRo+u9hu8a2uSVv8xxz6b3z/GnKNkdlaxH1mgg+SPRHpJipC09FEVNzbpH/DQUSe+ PqYFMB9zd4sW/2eU+oKHnpP+JVeDTzEGqcytIzz3/4Iiu2gD6cIvesqrUbJPMDd/uYav Mfl7gmJ9psaDUbUsUAAHJAWaMRSq139GbLcKOPvzZ5TSNYAJDvHqePHoYygOk8EY6iot PTlViL0t7mF5HdN3KXF1PMYk5tHWhzabBBeGmRgt/aRdZKUkLrB1bTM1c/HQ7lrLJk2j YiP3OkpC5bdrRKJtygWm8+WVk30XFUhg/tQhvrnIq63OlGwY9A+sbX2y3H6y+RxfoI5g nLVw== 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=bNaFCVlxqfNSDeH/MpiqHCrWCjkEK3bBtnYpIGlS6sQ=; b=tprQ3OJFBcsbEmrZnRqSiO/HqcaVB69/lh7CIITAYy9k/LhJoaP2DlQ53A0fYnF1Wd BN3MLpLO0NhzXcdalemkX1MMxfisgWHyEkvITEuIXr+wZSF8/bLXXE0wgh7yyG1yoGcG +1da2gyusAX0JUGpO4M3z1v7XMJvm2ncryU+8KZberRby6Ij9mZk/lM0TtjeiJtPzY0i MPU9PXb33j06hUlwAeWiUItT6yFlaikcQd1NeBrY1CIq4gwsZmvubd3HJILioLRBYj3F ILq8CHYi3oXXOZAC8ANt5QrgtU8K2FmJRJtIJQL3DtvRKOTj+FTS6fi9bb76S/9dIOOx ZxLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rbi6N0l0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id e10-20020a50fb8a000000b00506953a1ad4si9119213edq.178.2023.04.19.03.33.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 03:33:35 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rbi6N0l0; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 DBBC73858C50 for ; Wed, 19 Apr 2023 10:33:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBBC73858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681900412; bh=bNaFCVlxqfNSDeH/MpiqHCrWCjkEK3bBtnYpIGlS6sQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rbi6N0l0xA/ZkIuCWi9yWpW3JdJScLl0KUm+pKThf/U2wW3eDyUY6iYqwFVN4jAlO T1MiPBAtQItdkNBKvTfB5ER/1oh+86pr9vUrcQSffurNhbdM/m7NQOup1v5z9IZftj cVeKmRSK6pjtpYVtcFBvgXxIp6tH//L4gUgKGDbU= 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 [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 71FF53858D1E for ; Wed, 19 Apr 2023 10:32:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 71FF53858D1E Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 966CB1FD8A for ; Wed, 19 Apr 2023 10:32:48 +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 8AFB72C141 for ; Wed, 19 Apr 2023 10:32:48 +0000 (UTC) Date: Wed, 19 Apr 2023 10:32:48 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Avoid repeated forwarder_block_p calls in CFG cleanup 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: <20230419103332.DBBC73858C50@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763600410340190837?= X-GMAIL-MSGID: =?utf-8?q?1763600410340190837?= CFG cleanup maintains BB_FORWARDER_BLOCK and uses FORWARDER_BLOCK_P to check that apart from two places which use forwarder_block_p in outgoing_edges_match alongside many BB_FORWARDER_BLOCK uses. The following adjusts those. Bootstrapped and tested on x86_64-unknown-linux-gnu, I verified cc1files produce the same code with/without this patch. OK? Thanks, Richard. * cfgcleanup.cc (outgoing_edges_match): Use FORWARDER_BLOCK_P. --- gcc/cfgcleanup.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cfgcleanup.cc b/gcc/cfgcleanup.cc index 78f59e99653..5f1aa29c89d 100644 --- a/gcc/cfgcleanup.cc +++ b/gcc/cfgcleanup.cc @@ -1861,9 +1861,9 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* fallthru edges must be forwarded to the same destination. */ if (fallthru1) { - basic_block d1 = (forwarder_block_p (fallthru1->dest) + basic_block d1 = (FORWARDER_BLOCK_P (fallthru1->dest) ? single_succ (fallthru1->dest): fallthru1->dest); - basic_block d2 = (forwarder_block_p (fallthru2->dest) + basic_block d2 = (FORWARDER_BLOCK_P (fallthru2->dest) ? single_succ (fallthru2->dest): fallthru2->dest); if (d1 != d2)