Message ID | ri6o7tdkkqz.fsf@suse.cz |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1062333wru; Fri, 11 Nov 2022 17:49:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6PyAyJS0Q/hyyML13IOxhKeN1b/btVegDboT2ulIRG2CcBl0M/QI9ddeaVU+E+yiHmG03N X-Received: by 2002:a17:906:7e4e:b0:7a8:3ecb:bd62 with SMTP id z14-20020a1709067e4e00b007a83ecbbd62mr3925405ejr.721.1668217747921; Fri, 11 Nov 2022 17:49:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668217747; cv=none; d=google.com; s=arc-20160816; b=LRmb+IwVBE6z8VFuMlMnH8Ww5SgFaz91WNy0C4CVyycEWYFX/aIIjK4V0sAfyE9AZt Tu0DzXhI05DbrHq6wA1qha5/atuX9z8dDKx9aLFb7U5yz4U8bkNTmzvyhwk8esOlrm2h jGdgHNimMUlroK5ScibbyfwkqvDStF2HEltaiir/Gvy7knD0IPNvM5ObZDMwXWsv5DZ4 8qvqSF+IMdjwOOlgDh67k9q1iJYWea4KDpkGFJMxURIjFEzDkqwVQWJ08G0G9XPDp2E5 y7NekRloI0oNTkh7yZ4UYCwey8C5IND3A8ZX7rcqxDp3EPIAnMfpijpQ7v2Q7I4iGdfW 7FAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:subject:cc:to:from:dkim-signature:dkim-signature :dmarc-filter:delivered-to; bh=m1F1MnxsXWTzJEkvoPejEncw67WGLvmcf01rkiOZ1qE=; b=v3PBahLdaDDKEESnhRtAzxyOfHSCs1T590N6ZfWMKxZRyW5ON7JWqaBYKh1ZbYGrMS JxJC7yJkvxjayXsiRFTDWBkdoOnrWPqXpaEwX7j+o5WVdFECU49uPHeqrfw46bnqdzQf ltTUiPC5d4H4s+fVb7WlxDsdVMWvJ4j00Fp8MGbMG3go6CfLFDT8eHrzQ7GaW6vapltH 05nJlcqPWNAWOD2vtWr/7paurrXfFnPxOGIZPB6XbCe1OkRBb5pzVRlUciP4p+yeg3pz A1dPhQjjNIxT47/NJeRw+K0Xm8CPa8SYCl0xxBuk1y+AUmPKCW947JHk/U7s1cJCZyco eGdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HX+Mh3v3; dkim=neutral (no key) header.i=@gcc.gnu.org header.b=Afy2mrLg; 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" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d17-20020a170906641100b00730a4246dd0si2645455ejm.593.2022.11.11.17.49.07 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 17:49:07 -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=@suse.cz header.s=susede2_rsa header.b=HX+Mh3v3; dkim=neutral (no key) header.i=@gcc.gnu.org header.b=Afy2mrLg; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40F023937415 for <ouuuleilei@gmail.com>; Sat, 12 Nov 2022 01:47:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 4CEB938A8157 for <gcc-patches@gcc.gnu.org>; Sat, 12 Nov 2022 01:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CEB938A8157 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8A0BC22329; Sat, 12 Nov 2022 01:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668217589; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=m1F1MnxsXWTzJEkvoPejEncw67WGLvmcf01rkiOZ1qE=; b=HX+Mh3v3BReMCNENTxFmkD3lDEawclJq9gqlICkkZpuit0dnQgOQyC+Uihy8QIIADzvGjG jysTucfutQX6hqla6KgzO2e3Od+wHckADBmJ2qG9/0qSlF/sPinXUn1bHCRO0l0JSr7H8r tKfsKpe5xK+UDD+0umbF9mFEQvRHtB0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668217589; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=m1F1MnxsXWTzJEkvoPejEncw67WGLvmcf01rkiOZ1qE=; b=Afy2mrLgfs/cNM1iB758CrjAcpI7Ld0e/2Ik47Y6tkTMITcofUYGHYBXbwYTLHAn7Dtser +wUAgiXTwl7KJvBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7A90113A08; Sat, 12 Nov 2022 01:46:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id gPLnHfX6bmMwZAAAMHmgww (envelope-from <mjambor@suse.cz>); Sat, 12 Nov 2022 01:46:29 +0000 From: Martin Jambor <mjambor@suse.cz> To: GCC Patches <gcc-patches@gcc.gnu.org> Cc: Jan Hubicka <jh@suse.cz>, Jan Hubicka <hubicka@ucw.cz> Subject: [PATCH 06/12] ipa-cp: Leave removal of unused parameters to IPA-SRA User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Sat, 12 Nov 2022 02:46:28 +0100 Message-ID: <ri6o7tdkkqz.fsf@suse.cz> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749253092987515515?= X-GMAIL-MSGID: =?utf-8?q?1749253092987515515?= |
Series |
[01/12] ipa: IPA-SRA split detection simplification
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Martin Jambor
Nov. 12, 2022, 1:46 a.m. UTC
Hi, looking at some benchmarks I have noticed many cases when IPA-CP cloned a function for all contexts just because it knew that some parameters were not used at all. Then IPA-SRA looked at the function and cloned it again to split another parameter or two. The latter pass is better equipped to detect when parameters can be altogether removed and so the IPA-CP cloning was for no good reason. This patch simply alters the IPA-CP not to do that in the situations where IPA-SRA can (for nodes which can be made local). Bootstrapped and tested on x86_64-linux. OK for master? Thanks, Martin gcc/ChangeLog: 2022-11-11 Martin Jambor <mjambor@suse.cz> * ipa-cp.cc (estimate_local_effects): Do not clone potentionally local nodes for all contexts just to remove unused parameters. --- gcc/ipa-cp.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index 02bd6a0fd1a..eb4474eb8b3 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -3722,7 +3722,10 @@ estimate_local_effects (struct cgraph_node *node) &removable_params_cost); int devirt_bonus = devirtualization_time_bonus (node, &avals); if (always_const || devirt_bonus - || (removable_params_cost && node->can_change_signature)) + || (removable_params_cost + && node->can_change_signature + /* If IPA-SRA can do it, it can do it better. */ + && !node->can_be_local_p ())) { struct caller_statistics stats; ipa_call_estimates estimates;