From: Sebastian Buchwald Date: Thu, 22 Jul 2010 11:08:16 +0000 (+0000) Subject: Fixed compile errors for enabled KAPS_STATISTIC. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=616077bdd98fa8b5bb9c1a12102d54b016d91d86;p=libfirm Fixed compile errors for enabled KAPS_STATISTIC. [r27775] --- diff --git a/brute_force.c b/brute_force.c index e41f46857..8785af05a 100644 --- a/brute_force.c +++ b/brute_force.c @@ -43,6 +43,10 @@ #include "pbqp_node_t.h" #include "vector.h" +#if KAPS_STATISTIC +static int dump = 0; +#endif + /* Forward declarations. */ static void apply_Brute_Force(pbqp *pbqp); diff --git a/heuristical.c b/heuristical.c index f202c74e2..00f3993b3 100644 --- a/heuristical.c +++ b/heuristical.c @@ -77,12 +77,10 @@ static void apply_RN(pbqp *pbqp) #endif #if KAPS_STATISTIC - if (dump == 0) { - FILE *fh = fopen("solutions.pb", "a"); - fprintf(fh, "[%u]", min_index); - fclose(fh); - pbqp->num_rn++; - } + FILE *fh = fopen("solutions.pb", "a"); + fprintf(fh, "[%u]", min_index); + fclose(fh); + pbqp->num_rn++; #endif /* Now that we found the local minimum set all other costs to infinity. */ diff --git a/heuristical_co.c b/heuristical_co.c index d3452409b..5759a5d27 100644 --- a/heuristical_co.c +++ b/heuristical_co.c @@ -92,12 +92,10 @@ static void apply_RN_co(pbqp *pbqp, plist_t *rpeo) #endif #if KAPS_STATISTIC - if (dump == 0) { FILE *fh = fopen("solutions.pb", "a"); fprintf(fh, "[%u]", min_index); fclose(fh); pbqp->num_rn++; - } #endif /* Now that we found the local minimum set all other costs to infinity. */ @@ -108,18 +106,11 @@ static void apply_heuristic_reductions_co(pbqp *pbqp, plist_t *rpeo) { #if KAPS_TIMING /* create timers */ - ir_timer_t *t_edge = ir_timer_register("be_pbqp_edges", "pbqp reduce independent edges"); - ir_timer_t *t_r0 = ir_timer_register("be_pbqp_r0", "pbqp R0 reductions"); - ir_timer_t *t_r1 = ir_timer_register("be_pbqp_r1", "pbqp R1 reductions"); - ir_timer_t *t_r2 = ir_timer_register("be_pbqp_r2", "pbqp R2 reductions"); - ir_timer_t *t_rn = ir_timer_register("be_pbqp_rN", "pbqp RN reductions"); - - /* reset timers */ - ir_timer_reset(t_edge); - ir_timer_reset(t_r0); - ir_timer_reset(t_r1); - ir_timer_reset(t_r2); - ir_timer_reset(t_rn); + ir_timer_t *t_edge = ir_timer_new(); + ir_timer_t *t_r0 = ir_timer_new(); + ir_timer_t *t_r1 = ir_timer_new(); + ir_timer_t *t_r2 = ir_timer_new(); + ir_timer_t *t_rn = ir_timer_new(); #endif for (;;) { @@ -165,11 +156,11 @@ static void apply_heuristic_reductions_co(pbqp *pbqp, plist_t *rpeo) #endif } else { #if KAPS_TIMING - printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_edge), (double)ir_timer_elapsed_usec(t_edge) / 1000.0); - printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r0), (double)ir_timer_elapsed_usec(t_r0) / 1000.0); - printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r1), (double)ir_timer_elapsed_usec(t_r1) / 1000.0); - printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_r2), (double)ir_timer_elapsed_usec(t_r2) / 1000.0); - printf("%-20s: %8.3lf msec\n", ir_timer_get_description(t_rn), (double)ir_timer_elapsed_usec(t_rn) / 1000.0); + printf("pbqp reduce independent edges: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_edge) / 1000.0); + printf("pbqp R0 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r0) / 1000.0); + printf("pbqp R1 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r1) / 1000.0); + printf("pbqp R2 reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_r2) / 1000.0); + printf("pbqp RN reductions: %8.3lf msec\n", (double)ir_timer_elapsed_usec(t_rn) / 1000.0); #endif return; diff --git a/optimal.h b/optimal.h index 5424b599e..e71a159e4 100644 --- a/optimal.h +++ b/optimal.h @@ -39,7 +39,7 @@ void apply_RI(pbqp *pbqp); void apply_RII(pbqp *pbqp); #if KAPS_STATISTIC -void check_melting_possibility(pbqp *pbqp, pbqp_edge *edge) +void check_melting_possibility(pbqp *pbqp, pbqp_edge *edge); #endif void back_propagate(pbqp *pbqp);