diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-02-20 19:40:14 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@ucw.cz> | 2014-02-20 19:40:14 +0000 |
commit | 95866f1d6259b561a0481dcc707571063716d211 (patch) | |
tree | 22fc0608899d441a62331836ae31204af56c2bd3 /gcc/lto | |
parent | 643ad74480230c2e8e35f35a64d5f6d6ebf31c5e (diff) |
* lto-partition.c (add_symbol_to_partition_1,
undo_partition, lto_balanced_map): Aliases have no
defined size.
(lto_balanced_map): Do not follow refering variables
if they can be optimized out.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@207967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/lto/lto-partition.c | 16 |
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 9b0c61a9c44..b1a40553f5a 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,11 @@ +2014-02-14 Jan Hubicka <hubicka@ucw.cz> + + * lto-partition.c (add_symbol_to_partition_1, + undo_partition, lto_balanced_map): Aliases have no + defined size. + (lto_balanced_map): Do not follow refering variables + if they can be optimized out. + 2014-02-14 Richard Biener <rguenther@suse.de> PR lto/60179 diff --git a/gcc/lto/lto-partition.c b/gcc/lto/lto-partition.c index c638cec1795..1ee5fbb851e 100644 --- a/gcc/lto/lto-partition.c +++ b/gcc/lto/lto-partition.c @@ -149,7 +149,8 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node) if (cgraph_node *cnode = dyn_cast <cgraph_node> (node)) { struct cgraph_edge *e; - part->insns += inline_summary (cnode)->self_size; + if (!node->alias) + part->insns += inline_summary (cnode)->self_size; /* Add all inline clones and callees that are duplicated. */ for (e = cnode->callees; e; e = e->next_callee) @@ -244,13 +245,14 @@ undo_partition (ltrans_partition partition, unsigned int n_nodes) { symtab_node *node = lto_symtab_encoder_deref (partition->encoder, n_nodes); + cgraph_node *cnode; /* After UNDO we no longer know what was visited. */ if (partition->initializers_visited) pointer_set_destroy (partition->initializers_visited); partition->initializers_visited = NULL; - if (cgraph_node *cnode = dyn_cast <cgraph_node> (node)) + if (!node->alias && (cnode = dyn_cast <cgraph_node> (node))) partition->insns -= inline_summary (cnode)->self_size; lto_symtab_encoder_delete_node (partition->encoder, node); node->aux = (void *)((size_t)node->aux - 1); @@ -439,7 +441,8 @@ lto_balanced_map (void) if (symtab_get_symbol_partitioning_class (node) == SYMBOL_PARTITION) { order[n_nodes++] = node; - total_size += inline_summary (node)->size; + if (!node->alias) + total_size += inline_summary (node)->size; } /* Streaming works best when the source units do not cross partition @@ -495,7 +498,8 @@ lto_balanced_map (void) } add_symbol_to_partition (partition, order[i]); - total_size -= inline_summary (order[i])->size; + if (!order[i]->alias) + total_size -= inline_summary (order[i])->size; /* Once we added a new node to the partition, we also want to add @@ -613,7 +617,11 @@ lto_balanced_map (void) vnode = ipa_ref_referring_varpool_node (ref); gcc_assert (vnode->definition); + /* It is better to couple variables with their users, because it allows them + to be removed. Coupling with objects they refer to only helps to reduce + number of symbols promoted to hidden. */ if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder + && !varpool_can_remove_if_no_refs (vnode) && symtab_get_symbol_partitioning_class (vnode) == SYMBOL_PARTITION) add_symbol_to_partition (partition, vnode); index = lto_symtab_encoder_lookup (partition->encoder, |