From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id CF936395A073 for ; Wed, 16 Nov 2022 13:33:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF936395A073 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id E57BA284AB2; Wed, 16 Nov 2022 14:33:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1668605589; h=from:from:reply-to:subject:subject: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=svC0beaFYGqxEEp0crTS4JDXY2fmcf5C0QHXp2bYpZM=; b=GqWyf6gpKnGknV0G01BtX3ckRMKNonlq+fNA6PU+dFB7tFzXa+uCL09EBvB1h/y35vjYdh pL8+kncRdg68OxjEi0k/dTFBZh9/SZS2hZ+OWXjo5UuOjp3hhiTqHWG5zxXm6Lt+xQ23qu CMr/f6oAKc2RvZDScrkFaEVnAeKtl/o= Date: Wed, 16 Nov 2022 14:33:09 +0100 From: Jan Hubicka To: Martin Jambor Cc: GCC Patches Subject: Re: [PATCH 03/12] ipa-cp: Write transformation summaries of all functions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: > Hi, > > IPA-CP transformation summary streaming code currently won't stream > out transformations necessary for clones which are only necessary for > materialization of other clones (such as an IPA-CP clone which is then > cloned again by IPA-SRA). However, a follow-up patch for bettor > reconciling IPA-SRA and IPA-CP modifications requires to have that > information at its disposal and so this one reworks the streaming to > write out all non-empty transformation summaries. > > This should actually mean less streaming in typical case because > previously we streamed three zeros for all nodes in a partition with > no useful information associated with them. Currently we don't stream > anything for those. > > When reworking the streaming, I also simplified it a little a > converted it writing to nicer C++ vector iterations. > > Bootstrapped and tested on x86_64-linux. OK for master? > > Thanks, > > Martin > > > gcc/ChangeLog: > > 2022-11-11 Martin Jambor > > * ipa-prop.cc (useful_ipcp_transformation_info_p): New function. > (write_ipcp_transformation_info): Added a parameter, simplified > given that is known not to be NULL. > (ipcp_write_transformation_summaries): Write out all useful > transformation summaries. > (read_ipcp_transformation_info): Simplify given that some info > will be read. > (read_replacements_section): Remove assert. > --- > gcc/ipa-prop.cc | 151 +++++++++++++++++++++++------------------------- > 1 file changed, 71 insertions(+), 80 deletions(-) > > diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc > index e6cf25591b3..cfd12a97b36 100644 > --- a/gcc/ipa-prop.cc > +++ b/gcc/ipa-prop.cc > @@ -5279,80 +5279,72 @@ ipa_prop_read_jump_functions (void) > } > } > > -void > -write_ipcp_transformation_info (output_block *ob, cgraph_node *node) > +/* Return true if the IPA-CP transformation summary TS is non-NULL and contains > + useful info. */ > +static bool > +useful_ipcp_transformation_info_p (ipcp_transformation *ts) > { > - int node_ref; > - unsigned int count = 0; > - lto_symtab_encoder_t encoder; > + if (!ts) > + return false; > + if (!vec_safe_is_empty (ts->m_agg_values) > + || !vec_safe_is_empty (ts->bits) > + || !vec_safe_is_empty (ts->m_vr)) > + return true; > + return false; > +} This way we stream transformation info for everything in the boundary. Even for functions that belongs to other partitions and they are called from current partition. Perhaps we want to check that the function has body streamed? Also would be possible to make a testcase? I think it should be possible to use -flto-partition=max and builtin_constant_p checks verifying that intended transformation happens. Honza