static int childno = -1;
+void print_partitions_statistics ();
+
static bool
maybe_compile_in_parallel (void)
{
if (!flag_parallel_jobs || !split_outputs)
return false;
+
+ struct timeval start, end;
+ gettimeofday(&start, NULL);
+
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (cnode)
{
ipa_size_summary *ss = ipa_size_summaries->get (cnode);
return false;
}
+
+ //print_partitions_statistics();
+ //exit(0);
+
/* Find out statics that need to be promoted
to globals with hidden visibility because they are accessed from
multiple partitions. */
jobserver_return_token ('p');
}
+
+ gettimeofday(&end, NULL);
+
+ long seconds = (end.tv_sec - start.tv_sec);
+ long micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("Partitioner: %ld.%06ld\n", seconds, micros);
+
+ gettimeofday(&start, NULL);
+
/* Spawn processes. Spawn as soon as there is a free slot. */
for (j = 0, i = -num_jobs; i < partitions; i++, j++)
{
now. */
if (jobserver)
jobserver_get_token ();
+
+
+ gettimeofday(&end, NULL);
+
+ seconds = (end.tv_sec - start.tv_sec);
+ micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("LTRANS: %ld.%06ld\n", seconds, micros);
exit (0);
}
void
symbol_table::compile (void)
{
+ struct timeval start, end;
+ long seconds, micros;
+
if (seen_error ())
return;
/* Don't run the IPA passes if there was any error or sorry messages. */
if (!seen_error ())
{
+
timevar_start (TV_CGRAPH_IPA_PASSES);
+
+ gettimeofday(&start, NULL);
ipa_passes ();
+ gettimeofday(&end, NULL);
+
+ seconds = (end.tv_sec - start.tv_sec);
+ micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("IPA: %ld.%06ld micros\n", seconds, micros);
+
maybe_compile_in_parallel ();
timevar_stop (TV_CGRAPH_IPA_PASSES);
}
return;
}
+
+ gettimeofday(&start, NULL);
+
global_info_ready = true;
if (dump_file)
{
state = FINISHED;
output_weakrefs ();
+ gettimeofday(&end, NULL);
+
+ seconds = (end.tv_sec - start.tv_sec);
+ micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("Intraprocedural: %ld.%06ld\n", seconds, micros);
+
if (dump_file)
{
fprintf (dump_file, "\nFinal ");
new_partition ("empty");
}
+void print_partitions_statistics()
+{
+ int n_partitions = ltrans_partitions.length();
+ int i;
+
+ printf ("Number of partitions: %d\n", n_partitions);
+
+ for (i = 0; i < n_partitions; i++)
+ {
+ ltrans_partition part = ltrans_partitions[i];
+ printf ("Partition: %d, Nr of insns: %d, Symbols: %d\n", i, part->insns,
+ part->symbols);
+
+ lto_symtab_encoder_iterator lsei;
+ lto_symtab_encoder_t encoder = part->encoder;
+
+ for (lsei = lsei_start (encoder); !lsei_end_p (lsei); lsei_next (&lsei))
+ {
+ if (cgraph_node *cnode = dyn_cast<cgraph_node *>(lsei_node (lsei)))
+ {
+ if (cnode->get_partitioning_class () == SYMBOL_PARTITION)
+ {
+ ipa_size_summary *summary = ipa_size_summaries->get (cnode);
+ if (summary)
+ printf (" Node id: %d, name: %s, insns: %d\n", cnode->order, cnode->name (), summary->size);
+ }
+ /*
+ else
+ printf (" Node: %s, Boundary\n", cnode->name ());
+ */
+ }
+ }
+ }
+
+ fflush (stdout);
+}
+
/* Class implementing a union-find algorithm. */
class union_find
ipa_size_summary *summary = ipa_size_summaries->get (cnode);
if (summary)
{
- printf("%s; %d\n", cnode->name (), summary->size);
sizes[root] += summary->size;
}
else
timevar_start (TV_PHASE_PARSING);
timevar_push (TV_PARSE_GLOBAL);
+ struct timeval start, end;
+
+ gettimeofday(&start, NULL);
/* Parse entire file and generate initial debug information. */
lang_hooks.parse_file ();
+ gettimeofday(&end, NULL);
+
+ long seconds = (end.tv_sec - start.tv_sec);
+ long micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
+
+ printf("Parsing: %ld.%06ld\n", seconds, micros);
+
timevar_pop (TV_PARSE_GLOBAL);
timevar_stop (TV_PHASE_PARSING);