summaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 00:50:24 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-08 00:50:24 +0000
commit1e52cb3cffe5a82af16789a1349cee2a5ccdfd06 (patch)
treef781f5633eb83ef53a309e2e07f5fb611dab1ed8 /gcc/lto
parent7746395bf4adaf161ab72b1111efc21f938e587b (diff)
downloadgcc-1e52cb3cffe5a82af16789a1349cee2a5ccdfd06.tar.gz
* lto.c (lto_balanced_map): Fix accounting of program size.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index fbe447f5fc2..ea393ba6a38 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,5 +1,9 @@
2010-10-06 Jan Hubicka <jh@suse.cz>
+ * lto.c (lto_balanced_map): Fix accounting of program size.
+
+2010-10-06 Jan Hubicka <jh@suse.cz>
+
* lto.c (lto_balanced_map): Do not produce empty partitions.
2010-10-06 Andi Kleen <ak@linux.intel.com>
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 25280a7bda9..3baea802a1e 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -995,7 +995,7 @@ lto_balanced_map (void)
struct cgraph_node **order = XNEWVEC (struct cgraph_node *, cgraph_max_uid);
int i, postorder_len;
struct cgraph_node *node;
- int total_size = 0;
+ int total_size = 0, best_total_size = 0;
int partition_size;
ltrans_partition partition;
unsigned int last_visited_cgraph_node = 0, last_visited_varpool_node = 0;
@@ -1017,7 +1017,7 @@ lto_balanced_map (void)
if (partition_cgraph_node_p (node))
{
order[n_nodes++] = node;
- total_size += node->local.inline_summary.self_size;
+ total_size += node->global.size;
}
}
free (postorder);
@@ -1035,6 +1035,7 @@ lto_balanced_map (void)
for (i = 0; i < n_nodes; i++)
{
add_cgraph_node_to_partition (partition, order[i]);
+ total_size -= order[i]->global.size;
/* Once we added a new node to the partition, we also want to add
all referenced variables unless they was already added into some
@@ -1069,7 +1070,6 @@ lto_balanced_map (void)
last_visited_cgraph_node);
refs = &node->ref_list;
- total_size -= node->local.inline_summary.self_size;
last_visited_cgraph_node++;
gcc_assert (node->analyzed);
@@ -1195,6 +1195,7 @@ lto_balanced_map (void)
partition->cgraph_set->nodes);
best_n_varpool_nodes = VEC_length (varpool_node_ptr,
partition->varpool_set->nodes);
+ best_total_size = total_size;
}
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Step %i: added %s, size %i, cost %i/%i best %i/%i, step %i\n", i,
@@ -1218,6 +1219,7 @@ lto_balanced_map (void)
partition = new_partition ("");
last_visited_cgraph_node = 0;
last_visited_varpool_node = 0;
+ total_size = best_total_size;
cost = 0;
if (cgraph_dump_file)