summaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 12d2d19e944..7e01c9d8a61 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2782,6 +2782,8 @@ static bool is_number (const char *str)
static int childno = -1;
+void print_partitions_statistics ();
+
static bool
maybe_compile_in_parallel (void)
{
@@ -2800,6 +2802,10 @@ 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);
@@ -2869,6 +2875,10 @@ maybe_compile_in_parallel (void)
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. */
@@ -2902,6 +2912,16 @@ maybe_compile_in_parallel (void)
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++)
{
@@ -2942,6 +2962,14 @@ maybe_compile_in_parallel (void)
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);
}
@@ -2951,6 +2979,9 @@ maybe_compile_in_parallel (void)
void
symbol_table::compile (void)
{
+ struct timeval start, end;
+ long seconds, micros;
+
if (seen_error ())
return;
@@ -2970,8 +3001,18 @@ symbol_table::compile (void)
/* 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);
}
@@ -2984,6 +3025,9 @@ symbol_table::compile (void)
return;
}
+
+ gettimeofday(&start, NULL);
+
global_info_ready = true;
if (dump_file)
{
@@ -3051,6 +3095,13 @@ symbol_table::compile (void)
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 ");