From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 3B3D838582A1 for ; Sun, 13 Nov 2022 21:06:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B3D838582A1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass 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 018F0226B2; Sun, 13 Nov 2022 21:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668373585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=C6m2cpy//ChZiC78g14QslsHhRkuGX6B3KZalZllV/s=; b=MkDj30VrnDYGGc9JsTSn49Hze0KbQkUw7f3SrykxfI7pXh6G/+Tz82buV3KLoJe+vjoIei nC3Sv2u69l2SqL1AOcW1xqX9qDFwmib/Xt59NxAMyN2EhY9n4W935UO1d7dcq5qpyh0NlP slVW5XPbW4k7RPUYRVDxaAUHmHmPyQo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668373585; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=C6m2cpy//ChZiC78g14QslsHhRkuGX6B3KZalZllV/s=; b=E9137dUCOdUNlp7MdQ9/XbD+pVeWT/h4jIL1YigGeTjX0ndmASZDm11eJ9hvrrKfTMbqdx 6Cn5ytU7Z2T6JNBQ== 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 E38C313273; Sun, 13 Nov 2022 21:06:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GE9+N1BccWNmLwAAMHmgww (envelope-from ); Sun, 13 Nov 2022 21:06:24 +0000 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka , Jan Hubicka Subject: Re: [PATCH 02/12] ipa-cp: Do not consider useless aggregate constants In-Reply-To: References: User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Sun, 13 Nov 2022 22:06:24 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: 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 * 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 *lat = &plats->itself; ipcp_lattice *ctxlat = &plats->ctxlat; -- 2.38.0