public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Martin Jambor <mjambor@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 03/12] ipa-cp: Write transformation summaries of all functions
Date: Wed, 16 Nov 2022 14:33:09 +0100	[thread overview]
Message-ID: <Y3TmlafeWN0fpOWv@kam.mff.cuni.cz> (raw)
In-Reply-To: <ri6sfipkksb.fsf@suse.cz>

> 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  <mjambor@suse.cz>
> 
> 	* 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

  reply	other threads:[~2022-11-16 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12  1:45 Martin Jambor
2022-11-16 13:33 ` Jan Hubicka [this message]
2022-11-28 15:46   ` Martin Jambor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3TmlafeWN0fpOWv@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mjambor@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).