aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-reference.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2020-06-01 15:57:32 +0200
committerJan Hubicka <jh@suse.cz>2020-06-01 15:57:32 +0200
commitff7da2b5d621d0aaf4a467344d0621eefd4aa78f (patch)
treea0e9ee399c1b3a9360691446bca622ae11e2d109 /gcc/ipa-reference.c
parentc055929ff2de906b7706428d42152b1a51cb3b0a (diff)
downloadgcc-ff7da2b5d621d0aaf4a467344d0621eefd4aa78f.zip
gcc-ff7da2b5d621d0aaf4a467344d0621eefd4aa78f.tar.gz
gcc-ff7da2b5d621d0aaf4a467344d0621eefd4aa78f.tar.bz2
Cleanup global decl stream reference streaming, part 1
This patch further simplifies way we reffer to global stream. Every function section has vector of references to global trees which are populated during streaming. This vector is for some reason divided into field_decls, fn_decls, type_decls, types, namespace_decls, labels_decls and var_decls which contains also other things. There is no benefit for this split except perhaps for making the indexes bit smaller and possibly better encodable by ulebs. This however does not pay back and makes things unnecesarily complex. We may want to re-add multiple tables if we start streaming something else than trees into the global stream, but that would not work with current infrastructure anyway. The patch drops different streams and I checked that it results in reduction of global stream and apparently very small increase in function streams but it may be just because I updated tree in between the tests. This will be fixed by incremental patch. [WPA] Compression: 86220483 input bytes, 217762146 uncompressed bytes (ratio: 2.525643) [WPA] Compression: 111735464 input bytes, 297410918 uncompressed bytes (ratio: 2.661741) [WPA] Size of mmap'd section decls: 86220483 bytes [WPA] Size of mmap'd section function_body: 14353447 bytes to: [WPA] Compression: 85754594 input bytes, 216006049 uncompressed bytes (ratio: 2.518886) [WPA] Compression: 111370381 input bytes, 295746052 uncompressed bytes (ratio: 2.655518) [WPA] Size of mmap'd section decls: 85754594 bytes [WPA] Size of mmap'd section function_body: 14447946 bytes The patch also removes some of ugly macro generators of accessors functions and makes it easier to further optimize the way we stream references to trees which I plan to do incrementally. I also made the API for streaming referneces symmetric. I.e. you stream out by lto_output_var_decl_ref and stream in by lto_input_var_decl_ref instead streaming out by lto_output_var_decl_index and streaming in by decl_index = streamer_read_uhwi (ib); lto_file_decl_data_get_fn_decl (file_data, decl_index); lto-bootstrapped/regtested x86_64-linux, will commit it shortly. gcc/ChangeLog: 2020-06-01 Jan Hubicka <hubicka@ucw.cz> * ipa-reference.c (stream_out_bitmap): Use lto_output_var_decl_ref. (ipa_reference_read_optimization_summary): Use lto_intput_var_decl_ref. * lto-cgraph.c (lto_output_node): Likewise. (lto_output_varpool_node): Likewise. (output_offload_tables): Likewise. (input_node): Likewise. (input_varpool_node): Likewise. (input_offload_tables): Likewise. * lto-streamer-in.c (lto_input_tree_ref): Declare. (lto_input_var_decl_ref): Declare. (lto_input_fn_decl_ref): Declare. * lto-streamer-out.c (lto_indexable_tree_ref): Use only one decl stream. (lto_output_var_decl_index): Rename to .. (lto_output_var_decl_ref): ... this. (lto_output_fn_decl_index): Rename to ... (lto_output_fn_decl_ref): ... this. * lto-streamer.h (enum lto_decl_stream_e_t): Remove per-type streams. (DEFINE_DECL_STREAM_FUNCS): Remove. (lto_output_var_decl_index): Remove. (lto_output_fn_decl_index): Remove. (lto_output_var_decl_ref): Declare. (lto_output_fn_decl_ref): Declare. (lto_input_var_decl_ref): Declare. (lto_input_fn_decl_ref): Declare.
Diffstat (limited to 'gcc/ipa-reference.c')
-rw-r--r--gcc/ipa-reference.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index c08d84d..c9bc148 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -1039,7 +1039,7 @@ stream_out_bitmap (struct lto_simple_output_block *ob,
EXECUTE_IF_AND_IN_BITMAP (bits, ltrans_statics, 0, index, bi)
{
tree decl = (*reference_vars_to_consider) [index];
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, decl);
+ lto_output_var_decl_ref (ob->decl_state, ob->main_stream, decl);
}
}
@@ -1158,9 +1158,7 @@ ipa_reference_read_optimization_summary (void)
fprintf (dump_file, "all module statics:");
for (i = 0; i < (unsigned int)b_count; i++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bool existed;
bitmap_set_bit (all_module_statics,
ipa_reference_var_get_or_insert_uid
@@ -1206,9 +1204,7 @@ ipa_reference_read_optimization_summary (void)
(&optimization_summary_obstack);
for (j = 0; j < (unsigned int)v_count; j++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bitmap_set_bit (info->statics_read,
ipa_reference_var_uid (v_decl));
if (dump_file)
@@ -1235,9 +1231,7 @@ ipa_reference_read_optimization_summary (void)
(&optimization_summary_obstack);
for (j = 0; j < (unsigned int)v_count; j++)
{
- unsigned int var_index = streamer_read_uhwi (ib);
- tree v_decl = lto_file_decl_data_get_var_decl (file_data,
- var_index);
+ tree v_decl = lto_input_var_decl_ref (ib, file_data);
bitmap_set_bit (info->statics_written,
ipa_reference_var_uid (v_decl));
if (dump_file)