fix warning
[libfirm] / ir / be / beblocksched.c
index c11ef72..e97b183 100644 (file)
@@ -43,6 +43,7 @@ typedef enum _blocksched_algos_t {
 
 static int algo = BLOCKSCHED_GREEDY;
 
+#ifdef WITH_LIBCORE
 static const lc_opt_enum_int_items_t blockschedalgo_items[] = {
        { "naiv",       BLOCKSCHED_NAIV },
        { "extbb",      BLOCKSCHED_EXTBB },
@@ -61,6 +62,7 @@ static const lc_opt_table_entry_t be_blocksched_options[] = {
        LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var),
        { NULL }
 };
+#endif
 
 /*
  *   ____                   _
@@ -128,7 +130,7 @@ static void collect_egde_frequency(ir_node *block, void *data)
        } else {
                int    i;
                double highest_execfreq = -1;
-               int    highest_edge_num;
+               int    highest_edge_num = -1;
 
                edge.block = block;
                for (i = 0; i < arity; ++i) {
@@ -148,7 +150,8 @@ static void collect_egde_frequency(ir_node *block, void *data)
                        }
                }
 
-               env->edges[highest_edge_num].highest_execfreq = 1;
+               if(highest_edge_num >= 0)
+                       env->edges[highest_edge_num].highest_execfreq = 1;
        }
 }
 
@@ -213,7 +216,7 @@ static void coalesce_blocks(blocksched_env_t *env)
                entry      = get_irn_link(block);
                pred_entry = get_irn_link(pred_block);
 
-               /* TODO: what's this check for? */
+               /* is 1 of the blocks already attached to another block? */
                if (pred_entry->next != NULL || entry->prev != NULL)
                        continue;
 
@@ -490,8 +493,6 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
 {
        int  i;
        int  edge_count = ARR_LEN(env->ilpedges);
-       FILE *f;
-       char fname[256];
 
        /* complete out constraints */
        for(i = 0; i < edge_count; ++i) {
@@ -512,11 +513,18 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
                lpp_set_factor_fast(env->lpp, entry->out_cst, edge->ilpvar, 1.0);
        }
 
-       lpp_dump(env->lpp, "lpp.out");
-       snprintf(fname, sizeof(fname), "lpp_%s.plain", get_irg_dump_name(env->env.irg));
-       f = fopen(fname, "w");
-       lpp_dump_plain(env->lpp, f);
-       fclose(f);
+#if 0
+       {
+               FILE *f;
+               char fname[256];
+               lpp_dump(env->lpp, "lpp.out");
+               snprintf(fname, sizeof(fname), "lpp_%s.plain", get_irg_dump_name(env->env.irg));
+               f = fopen(fname, "w");
+               lpp_dump_plain(env->lpp, f);
+               fclose(f);
+       }
+#endif
+
        //lpp_solve_net(env->lpp, main_env->options->ilp_server, main_env->options->ilp_solver);
        lpp_solve_net(env->lpp, "i44pc52", "cplex");
        assert(lpp_is_sol_valid(env->lpp));