public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ilya Verbin <iverbin@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>,
	Richard Biener <rguenther@suse.de>,	Jan Hubicka <hubicka@ucw.cz>
Cc: Kirill Yukhin <kirill.yukhin@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: LTO streaming of TARGET_OPTIMIZE_NODE
Date: Sun, 11 Jan 2015 21:28:00 -0000	[thread overview]
Message-ID: <20150111203741.GC30445@msticlxl57.ims.intel.com> (raw)
In-Reply-To: <20150109114503.GW1405@tucnak.redhat.com>

On 09 Jan 12:45, Jakub Jelinek wrote:
> --- gcc/cgraphunit.c.jj	2015-01-09 12:01:33.000000000 +0100
> +++ gcc/cgraphunit.c	2015-01-09 12:22:27.742692667 +0100
> @@ -2108,11 +2108,14 @@ ipa_passes (void)
>        if (g->have_offload)
>  	{
>  	  section_name_prefix = OFFLOAD_SECTION_NAME_PREFIX;
> +	  lto_stream_offload_p = true;
>  	  ipa_write_summaries (true);
> +	  lto_stream_offload_p = false;
>  	}
>        if (flag_lto)
>  	{
>  	  section_name_prefix = LTO_SECTION_NAME_PREFIX;
> +	  lto_stream_offload_p = false;
>  	  ipa_write_summaries (false);
>  	}

Now when we have a global flag, there is no longer need to pass a flag to
ipa_write_summaries and to select_what_to_stream.

Bootstrapped/regtested on x86_64-linux and i686-linux, OK for trunk?


gcc/
	* cgraphunit.c (ipa_passes): Remove argument from ipa_write_summaries.
	* lto-cgraph.c (select_what_to_stream): Remove argument, use
	lto_stream_offload_p instead.
	* lto-streamer.h (select_what_to_stream): Remove argument.
	* passes.c (ipa_write_summaries): Likewise.
	* tree-pass.h (ipa_write_summaries): Likewise.
gcc/lto/
	* lto-partition.c (lto_promote_cross_file_statics): Remove argument
	from select_what_to_stream.


diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 149f447..1ef1b6c 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2115,14 +2115,14 @@ ipa_passes (void)
 	{
 	  section_name_prefix = OFFLOAD_SECTION_NAME_PREFIX;
 	  lto_stream_offload_p = true;
-	  ipa_write_summaries (true);
+	  ipa_write_summaries ();
 	  lto_stream_offload_p = false;
 	}
       if (flag_lto)
 	{
 	  section_name_prefix = LTO_SECTION_NAME_PREFIX;
 	  lto_stream_offload_p = false;
-	  ipa_write_summaries (false);
+	  ipa_write_summaries ();
 	}
     }
 
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 6c6501a..91be530 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -842,11 +842,11 @@ create_references (lto_symtab_encoder_t encoder, symtab_node *node)
 /* Select what needs to be streamed out.  In regular lto mode stream everything.
    In offload lto mode stream only nodes marked as offloadable.  */
 void
-select_what_to_stream (bool offload_lto_mode)
+select_what_to_stream (void)
 {
   struct symtab_node *snode;
   FOR_EACH_SYMBOL (snode)
-    snode->need_lto_streaming = !offload_lto_mode || snode->offloadable;
+    snode->need_lto_streaming = !lto_stream_offload_p || snode->offloadable;
 }
 
 /* Find all symbols we want to stream into given partition and insert them
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 853630f..2d9f30c 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -837,7 +837,7 @@ bool referenced_from_this_partition_p (symtab_node *,
 bool reachable_from_this_partition_p (struct cgraph_node *,
 				      lto_symtab_encoder_t);
 lto_symtab_encoder_t compute_ltrans_boundary (lto_symtab_encoder_t encoder);
-void select_what_to_stream (bool);
+void select_what_to_stream (void);
 
 /* In options-save.c.  */
 void cl_target_option_stream_out (struct output_block *, struct bitpack_d *,
diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c
index 38809d2..c1179cb 100644
--- a/gcc/lto/lto-partition.c
+++ b/gcc/lto/lto-partition.c
@@ -973,7 +973,8 @@ lto_promote_cross_file_statics (void)
 
   gcc_assert (flag_wpa);
 
-  select_what_to_stream (false);
+  lto_stream_offload_p = false;
+  select_what_to_stream ();
 
   /* First compute boundaries.  */
   n_sets = ltrans_partitions.length ();
diff --git a/gcc/passes.c b/gcc/passes.c
index 52dc067..e78a325 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2464,7 +2464,7 @@ ipa_write_summaries_1 (lto_symtab_encoder_t encoder)
 /* Write out summaries for all the nodes in the callgraph.  */
 
 void
-ipa_write_summaries (bool offload_lto_mode)
+ipa_write_summaries (void)
 {
   lto_symtab_encoder_t encoder;
   int i, order_pos;
@@ -2475,7 +2475,7 @@ ipa_write_summaries (bool offload_lto_mode)
   if ((!flag_generate_lto && !flag_generate_offload) || seen_error ())
     return;
 
-  select_what_to_stream (offload_lto_mode);
+  select_what_to_stream ();
 
   encoder = lto_symtab_encoder_new (false);
 
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 398ab83..9ff5bdc 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -603,7 +603,7 @@ extern void pass_fini_dump_file (opt_pass *);
 extern const char *get_current_pass_name (void);
 extern void print_current_pass (FILE *);
 extern void debug_pass (void);
-extern void ipa_write_summaries (bool);
+extern void ipa_write_summaries (void);
 extern void ipa_write_optimization_summaries (struct lto_symtab_encoder_d *);
 extern void ipa_read_summaries (void);
 extern void ipa_read_optimization_summaries (void);


  -- Ilya

  parent reply	other threads:[~2015-01-11 20:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  5:10 Jan Hubicka
2014-11-13 10:58 ` Richard Biener
2014-11-13 15:32   ` Jan Hubicka
2014-11-14  0:54     ` Jan Hubicka
2014-11-14  8:54       ` Richard Biener
2014-11-14 18:15       ` [BUILDROBOT] error: ‘cl_target_option_stream_in’ was not declared in this scope (was: LTO streaming of TARGET_OPTIMIZE_NODE) Jan-Benedict Glaw
2014-11-14 19:13         ` [BUILDROBOT] error: �??cl_target_option_stream_in�?? " Jan Hubicka
2014-11-15 17:07           ` Jan-Benedict Glaw
2014-11-20 13:09 ` LTO streaming of TARGET_OPTIMIZE_NODE Bernd Schmidt
2014-11-20 13:38   ` Richard Biener
2014-11-20 14:24     ` Bernd Schmidt
2014-11-20 21:51       ` Jan Hubicka
2015-01-08 14:12   ` Jakub Jelinek
2015-01-09 11:13     ` Thomas Schwinge
2015-01-09 11:50       ` Jakub Jelinek
2015-01-09 12:12         ` Richard Biener
2015-01-11 17:38         ` Jan Hubicka
2015-01-11 21:28         ` Ilya Verbin [this message]
2015-01-12 20:08           ` Jan Hubicka

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=20150111203741.GC30445@msticlxl57.ims.intel.com \
    --to=iverbin@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jakub@redhat.com \
    --cc=kirill.yukhin@gmail.com \
    --cc=rguenther@suse.de \
    /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).