lto-partition.c (add_symbol_to_partition_1, [...]): Aliases have no defined size.
* 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. From-SVN: r207967
This commit is contained in:
parent
672ce9397b
commit
39434bce6c
2 changed files with 20 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue