combos constant dataflow analysis has to be consistent with the localopt; this should...
[libfirm] / ir / be / becopyopt.c
index 930233e..32c9a89 100644 (file)
@@ -136,6 +136,7 @@ void be_register_copyopt(const char *name, co_algo_info *copyopt)
        be_add_module_to_list(&copyopts, name, copyopt);
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyopt);
 void be_init_copyopt(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
@@ -148,14 +149,13 @@ void be_init_copyopt(void)
                                       &copyopts, (void**) &selected_copyopt);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyopt);
-
 static int void_algo(copy_opt_t *co)
 {
        (void) co;
        return 0;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copynone);
 void be_init_copynone(void)
 {
        static co_algo_info copyheur = {
@@ -165,8 +165,6 @@ void be_init_copynone(void)
        be_register_copyopt("none", &copyheur);
 }
 
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copynone);
-
 #undef QUICK_AND_DIRTY_HACK
 
 static int nodes_interfere(const be_chordal_env_t *env, const ir_node *a, const ir_node *b)
@@ -312,8 +310,8 @@ static int ou_max_ind_set_costs(unit_t *ou)
        ir_node **safe, **unsafe;
        int i, o, safe_count, safe_costs, unsafe_count, *unsafe_costs;
        bitset_t *curr;
-       bitset_pos_t pos;
-       int max, curr_weight, best_weight = 0;
+       unsigned  pos;
+       int curr_weight, best_weight = 0;
 
        /* assign the nodes into two groups.
         * safe: node has no interference, hence it is in every max stable set.
@@ -365,7 +363,7 @@ static int ou_max_ind_set_costs(unit_t *ou)
                /* Exact Algorithm: Brute force */
                curr = bitset_alloca(unsafe_count);
                bitset_set_all(curr);
-               while ((max = bitset_popcnt(curr)) != 0) {
+               while (bitset_popcount(curr) != 0) {
                        /* check if curr is a stable set */
                        for (i=bitset_next_set(curr, 0); i!=-1; i=bitset_next_set(curr, i+1))
                                for (o=bitset_next_set(curr, i+1); o!=-1; o=bitset_next_set(curr, o+1)) /* !!!!! difference to qnode_max_ind_set(): NOT (curr, i) */
@@ -1070,7 +1068,7 @@ static void ifg_dump_at_end(FILE *file, void *self)
 
                        if (aidx < nidx) {
                                const char *color = nr == ar ? "blue" : "red";
-                               fprintf(file, "\tn%d -- n%d [weight=0.01 ", aidx, nidx);
+                               fprintf(file, "\tn%u -- n%u [weight=0.01 ", aidx, nidx);
                                if (env->flags & CO_IFG_DUMP_LABELS)
                                        fprintf(file, "label=\"%d\" ", n->costs);
                                if (env->flags & CO_IFG_DUMP_COLORS)
@@ -1225,7 +1223,7 @@ void co_driver(be_chordal_env_t *cenv)
        /* Dump the interference graph in Appel's format. */
        if (dump_flags & DUMP_APPEL) {
                FILE *f = my_open(cenv, "", ".apl");
-               fprintf(f, "# %lld %lld\n", after.costs, after.unsatisfied_edges);
+               fprintf(f, "# %llu %llu\n", after.costs, after.unsatisfied_edges);
                co_dump_appel_graph(co, f);
                fclose(f);
        }