Message ID | ri6tu35kksn.fsf@suse.cz |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A69638418A5 for <patchwork@sourceware.org>; Sat, 12 Nov 2022 01:45:47 +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 DB6BF3887F4E for <gcc-patches@gcc.gnu.org>; Sat, 12 Nov 2022 01:45:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB6BF3887F4E 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 1D0D222532; Sat, 12 Nov 2022 01:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668217529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=QsMZeET++YKl7lHt01TlkcYrSM751unyF63gH3XR0t4=; b=Q2FhlRM5Z5fC8CvsoQPIW+nzt2jxlRQCeXaCuZ8EdM0a3fNpnbjH6+FLL000byGIuRijqL QDMPuExSEeykzjj8QMhmK4aH5J5YudtBe2xsGI/g+qAbFe86RmOPAv5xpLE99GMm0wx/R1 pAdODcGVe5A2K8M8gijQWsoWWPVDl7Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668217529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=QsMZeET++YKl7lHt01TlkcYrSM751unyF63gH3XR0t4=; b=5jQMnZns7e7bEl24o5CGTlhPWnSsjADDIrAImKm+oVFTSlJrxrcf6AxtcTMjERdkoVr9I5 rHOyHgZgGolFHwDw== 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 0E1AE13273; Sat, 12 Nov 2022 01:45:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KD05A7n6bmO4YwAAMHmgww (envelope-from <mjambor@suse.cz>); Sat, 12 Nov 2022 01:45: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 02/12] ipa-cp: Do not consider useless aggregate constants User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Sat, 12 Nov 2022 02:45:28 +0100 Message-ID: <ri6tu35kksn.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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[01/12] ipa: IPA-SRA split detection simplification
|
|
Commit Message
Martin Jambor
Nov. 12, 2022, 1:45 a.m. UTC
Hi, When building vectors of known aggregate values, there is no point in including those for parameters which are not used in any way whatsoever. 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 (push_agg_values_from_edge): Do not consider constants in unused aggregate parameters. --- gcc/ipa-cp.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Sat, Nov 12 2022, Martin Jambor wrote: > Hi, > > When building vectors of known aggregate values, there is no point in > including those for parameters which are not used in any way > whatsoever. > > Bootstrapped and tested on x86_64-linux. OK for master? > > Thanks, > > Martin When doing LTO profiled-bootstrap, the original patch triggered a checking assert that a selected constant was not among those discovered to be known. The following avoids doing any heuristics for unused parameters too. With this patch, the whole series passes LTO profiled-bootstrap (and testing) on x86_64. Martin When building vectors of known aggregate values, there is no point in including those for parameters which are not used in any way whatsoever. This patch avoids that together with also other kinds of constants. gcc/ChangeLog: 2022-11-13 Martin Jambor <mjambor@suse.cz> * ipa-cp.cc (push_agg_values_from_edge): Do not consider constants in unused aggregate parameters. --- gcc/ipa-cp.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index d2bcd5e5e69..313336a9ccd 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -5783,7 +5783,8 @@ push_agg_values_from_edge (struct cgraph_edge *cs, } ipcp_param_lattices *plats = ipa_get_parm_lattices (dest_info, index); - if (plats->aggs_bottom) + if (!ipa_is_param_used (dest_info, index) + || plats->aggs_bottom) continue; push_agg_values_for_index_from_edge (cs, index, res, interim); } @@ -6147,6 +6148,9 @@ decide_whether_version_node (struct cgraph_node *node) for (i = 0; i < count;i++) { + if (!ipa_is_param_used (info, i)) + continue; + class ipcp_param_lattices *plats = ipa_get_parm_lattices (info, i); ipcp_lattice<tree> *lat = &plats->itself; ipcp_lattice<ipa_polymorphic_call_context> *ctxlat = &plats->ctxlat;
> Hi, > > When building vectors of known aggregate values, there is no point in > including those for parameters which are not used in any way > whatsoever. > > Bootstrapped and tested on x86_64-linux. OK for master? OK, thanks! Honza > > Thanks, > > Martin > > > gcc/ChangeLog: > > 2022-11-11 Martin Jambor <mjambor@suse.cz> > > * ipa-cp.cc (push_agg_values_from_edge): Do not consider constants > in unused aggregate parameters. > --- > gcc/ipa-cp.cc | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc > index d2bcd5e5e69..02bd6a0fd1a 100644 > --- a/gcc/ipa-cp.cc > +++ b/gcc/ipa-cp.cc > @@ -5783,7 +5783,8 @@ push_agg_values_from_edge (struct cgraph_edge *cs, > } > > ipcp_param_lattices *plats = ipa_get_parm_lattices (dest_info, index); > - if (plats->aggs_bottom) > + if (!ipa_is_param_used (dest_info, index) > + || plats->aggs_bottom) > continue; > push_agg_values_for_index_from_edge (cs, index, res, interim); > } > -- > 2.38.0 >
diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index d2bcd5e5e69..02bd6a0fd1a 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -5783,7 +5783,8 @@ push_agg_values_from_edge (struct cgraph_edge *cs, } ipcp_param_lattices *plats = ipa_get_parm_lattices (dest_info, index); - if (plats->aggs_bottom) + if (!ipa_is_param_used (dest_info, index) + || plats->aggs_bottom) continue; push_agg_values_for_index_from_edge (cs, index, res, interim); }