return QSORT_CMP(c, d);
}
-int cmp_edges(const void *a, const void *b)
+static int cmp_edges(const void *a, const void *b)
{
const edge_t *p = a;
const edge_t *q = b;
unsigned n_constr = 0;
unsigned i;
- n_constr = rbitset_popcnt(req->limited, n_regs);
+ n_constr = rbitset_popcount(req->limited, n_regs);
for (i = 0; i < n_regs; ++i) {
if (rbitset_is_set(req->limited, i)) {
col_costs[i].costs = add_saturated(col_costs[i].costs, costs / n_constr);
bitset_t *forb = bitset_alloca(n_regs);
affinity_node_t *a = ci->aff;
- bitset_pos_t elm;
+ unsigned elm;
const ir_node *pos;
void *it;
int i;
be_ifg_t *ifg = env->co->cenv->ifg;
bitset_t *bs = bitset_alloca(n_regs);
- bitset_pos_t elm;
+ unsigned elm;
const ir_node *irn;
void *it;
co2_irn_t *ni = get_co2_irn(env, irn);
admissible_colors(env, ni, bs);
- if (bitset_popcnt(bs) == 1) {
- bitset_pos_t c = bitset_next_set(bs, 0);
+ if (bitset_popcount(bs) == 1) {
+ unsigned c = bitset_next_set(bs, 0);
badness[c] += ci->costs;
}
ci->costs = costs;
cloud->costs += costs;
cloud->n_constr += is_constrained(env, &ci->inh);
- cloud->freedom += bitset_popcnt(get_adm(env, &ci->inh));
+ cloud->freedom += bitset_popcount(get_adm(env, &ci->inh));
cloud->max_degree = MAX(cloud->max_degree, ci->inh.aff->degree);
cloud->n_memb++;
co2_t env;
FILE *f;
- phase_init(&env.ph, "co2", co->cenv->birg->irg, PHASE_DEFAULT_GROWTH, co2_irn_init, NULL);
+ phase_init(&env.ph, co->cenv->birg->irg, co2_irn_init);
env.touched = NULL;
env.visited = 0;
env.co = co;
}
writeback_colors(&env);
- phase_free(&env.ph);
+ phase_deinit(&env.ph);
return 0;
}
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
void be_init_copyheur2(void)
{
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_add_table(co2_grp, options);
be_register_copyopt("heur2", ©heur);
}
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);