From patchwork Thu Dec 15 10:32:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 33567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp268504wrn; Thu, 15 Dec 2022 02:32:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Qfq0NBHbAn2DL1P7PI1M+ih9feM+DR775z9koz1OTBONTksr+6l93CRGwN+BxHIyk32+/ X-Received: by 2002:a05:6402:f24:b0:46d:ca42:2e59 with SMTP id i36-20020a0564020f2400b0046dca422e59mr27084868eda.11.1671100377218; Thu, 15 Dec 2022 02:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671100377; cv=none; d=google.com; s=arc-20160816; b=VZIReBeI6WdRwJiU5jKUByUidzJzw1SZnMfJVgboFjSUW4lz0yLn1LRkB1kTzP8bxr ucwvMCqkqt3S9Y5JnTjqMFZyt7AOawHteNh04XFjq4DgQVET0DnWI9nrqzqjNc6d3snX bTQ41IZSt4DPLsksL0E9wJz1+Dipd6r3tMYXyJyP7/Uh2KCFwi0A0sdrnLQGnuwTTZjG MvbdtQMYCXWYoYHn3FgoxezkGe4khWp3ZCP0wHxZgHjJiaPXIwQDimmeyLV7Tg8t4wdL H7k6SbgEAcqsEIjb3KnYf9cKeomTsOYDjVt4zFi9pJsOGDqF+Aae5APDfImlQUsHiRFm EMEA== 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=4S4zwmMYK4C69cVwFfx/yZ6TJoMWvuXdvIw5qytjf9I=; b=PoHnjMrQdtgckJcIfpgrwixzcxI3wFyNQBTSUrt2XpQee1T7+qWcCqxm7z0kvp8IBM Kn2rfjIjSYURNYls2aZYWHaUDCBRW541Z7A0NAEe4C+BDNh9N2vT9yY43UVPwv4Q/vua wS+rwfr18tbJwX52OgmqWdWpPTbFiZrzgDNZznmEeVWE06ZK47XuxNAnJbd47nGhM7cw 096hmx3csfHJxniU6MyK9zDx9PJViPFebkYlBnNgNY7smuYkz5F9Iv//Uc/JApq8Xxit sIF9qyQoTvvzrWI6cBM7mEdMlZwgSeJsCE9pMVG4qRd1FTEK6MjZlvlnUVW5hEHSTLaN 517Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=azS9Kh85; 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 s18-20020a508d12000000b00469047efecbsi13757193eds.62.2022.12.15.02.32.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 02:32:57 -0800 (PST) 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=azS9Kh85; 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 896A8388CA4D for ; Thu, 15 Dec 2022 10:32:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 896A8388CA4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671100373; bh=4S4zwmMYK4C69cVwFfx/yZ6TJoMWvuXdvIw5qytjf9I=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=azS9Kh85CVC7WYdNX7Pi9sAk62tp0HuLbgp3mVtUbE09mIQZQdnLtw7hTzFbzSxUm 9uCZPWRNf6n2zU68UUnUntVvyneOfFXqYkWM2TKaUBPcsvRhI9QdQpXHZS2FxeTCTL 0wsr5aXVH++DAiO2mp/e8hIKIaWuh5Azldd6nNWI= 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 A0D4A38362C7 for ; Thu, 15 Dec 2022 10:32:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0D4A38362C7 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 7F64B20F7E for ; Thu, 15 Dec 2022 10:32:06 +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 79E892C141 for ; Thu, 15 Dec 2022 10:32:06 +0000 (UTC) Date: Thu, 15 Dec 2022 10:32:06 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] middle-end/108086 - reduce operand scanner use from inliner 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 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: <20221215103253.896A8388CA4D@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752275749406842189?= X-GMAIL-MSGID: =?utf-8?q?1752275749406842189?= The following avoids a redundant second operand scan on all stmts during inlining which shows with PR108086. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR middle-end/108086 * tree-inline.cc (copy_edges_for_bb): Do not update all stmts again. --- gcc/tree-inline.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc index 15a1a389493..addfe7fcbcc 100644 --- a/gcc/tree-inline.cc +++ b/gcc/tree-inline.cc @@ -2571,12 +2571,8 @@ copy_edges_for_bb (basic_block bb, profile_count num, profile_count den, for (si = gsi_start_bb (new_bb); !gsi_end_p (si);) { - gimple *copy_stmt; bool can_throw, nonlocal_goto; - - copy_stmt = gsi_stmt (si); - if (!is_gimple_debug (copy_stmt)) - update_stmt (copy_stmt); + gimple *copy_stmt = gsi_stmt (si); /* Do this before the possible split_block. */ gsi_next (&si);