aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-02-20 20:40:14 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2014-02-20 19:40:14 +0000
commit39434bce6c165c21aa4226e860eaee9aa9efdbcf (patch)
tree22fc0608899d441a62331836ae31204af56c2bd3 /gcc
parent672ce9397b78c077e21d785a2ddf9fffd51a1952 (diff)
downloadgcc-39434bce6c165c21aa4226e860eaee9aa9efdbcf.zip
gcc-39434bce6c165c21aa4226e860eaee9aa9efdbcf.tar.gz
gcc-39434bce6c165c21aa4226e860eaee9aa9efdbcf.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/lto/ChangeLog8
-rw-r--r--gcc/lto/lto-partition.c16
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 9b0c61a..b1a4055 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 c638cec..1ee5fbb 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,