X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbecopyheur2.c;h=1d727c010ea0e2be9df52152dd2705a13cd595c5;hb=5ce100386043a57a864379c8b6d8e6bb95a98596;hp=7a1a00a04108ebc1b9611b6baae7d0743a926f1d;hpb=8a5ac70896b18a522fa39aad29b3c7cf36d5941e;p=libfirm diff --git a/ir/be/becopyheur2.c b/ir/be/becopyheur2.c index 7a1a00a04..1d727c010 100644 --- a/ir/be/becopyheur2.c +++ b/ir/be/becopyheur2.c @@ -45,14 +45,13 @@ #include "util.h" #include "irtools.h" #include "irnodemap.h" - +#include "be_t.h" #include "bemodule.h" #include "beabi.h" #include "benode.h" #include "becopyopt.h" #include "becopyopt_t.h" #include "bechordal_t.h" -#include "beirg.h" #define DUMP_BEFORE 1 #define DUMP_AFTER 2 @@ -334,17 +333,15 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co const ir_node *irn = ci->irn; be_ifg_t *ifg = env->co->cenv->ifg; int n_regs = env->co->cls->n_regs; - bitset_t *forb = bitset_alloca(n_regs); affinity_node_t *a = ci->aff; - size_t elm; const ir_node *pos; neighbours_iter_t it; int i; /* Put all forbidden colors into the aux bitset. */ - admissible_colors(env, ci, forb); - bitset_flip_all(forb); + bitset_t *const admissible = bitset_alloca(n_regs); + admissible_colors(env, ci, admissible); for (i = 0; i < n_regs; ++i) { col_costs[i].col = i; @@ -352,8 +349,6 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co } if (a) { - neighb_t *n; - co_gs_foreach_neighb(a, n) { if (color_is_fix(env, n->irn)) { col_t col = get_col(env, n->irn); @@ -377,7 +372,7 @@ static void determine_color_costs(co2_t *env, co2_irn_t *ci, col_cost_pair_t *co be_ifg_neighbours_break(&it); /* Set the costs to infinity for each color which is not allowed at this node. */ - bitset_foreach(forb, elm) { + bitset_foreach_clear(admissible, elm) { col_costs[elm].costs = INT_MAX; } @@ -402,16 +397,12 @@ static void single_color_cost(co2_t *env, co2_irn_t *ci, col_t col, col_cost_pai static void reject_coloring(struct list_head *h) { - co2_irn_t *pos; - list_for_each_entry(co2_irn_t, pos, h, changed_list) pos->tmp_fixed = 0; } static void materialize_coloring(struct list_head *h) { - co2_irn_t *pos; - list_for_each_entry(co2_irn_t, pos, h, changed_list) { pos->orig_col = pos->tmp_col; pos->tmp_fixed = 0; @@ -622,13 +613,11 @@ static void node_color_badness(co2_cloud_irn_t *ci, int *badness) be_ifg_t *ifg = env->co->cenv->ifg; bitset_t *bs = bitset_alloca(n_regs); - size_t elm; const ir_node *irn; neighbours_iter_t it; admissible_colors(env, &ci->inh, bs); - bitset_flip_all(bs); - bitset_foreach(bs, elm) + bitset_foreach_clear(bs, elm) badness[elm] = ci->costs; /* Use constrained/fixed interfering neighbors to influence the color badness */ @@ -780,7 +769,6 @@ static void populate_cloud(co2_t *env, co2_cloud_t *cloud, affinity_node_t *a, i be_ifg_t *ifg = env->co->cenv->ifg; co2_cloud_irn_t *ci = get_co2_cloud_irn(env, a->irn); int costs = 0; - neighb_t *n; if (ci->cloud) return; @@ -824,7 +812,6 @@ static void populate_cloud(co2_t *env, co2_cloud_t *cloud, affinity_node_t *a, i static co2_cloud_t *new_cloud(co2_t *env, affinity_node_t *a) { co2_cloud_t *cloud = OALLOC(&env->obst, co2_cloud_t); - co2_cloud_irn_t *ci; int i; DBG((env->dbg, LEVEL_2, "new cloud with %+F\n", a->irn)); @@ -893,7 +880,6 @@ static void process_cloud(co2_cloud_t *cloud) obstack_init(&cloud->obst); for (i = 0; i < cloud->n_memb; ++i) { co2_cloud_irn_t *ci = cloud->seq[i]; - neighb_t *n; co_gs_foreach_neighb(ci->inh.aff, n) { co2_cloud_irn_t *ni = get_co2_cloud_irn(cloud->env, n->irn); @@ -1010,7 +996,6 @@ static void process_cloud(co2_cloud_t *cloud) static int cloud_costs(co2_cloud_t *cloud) { int i, costs = 0; - neighb_t *n; for (i = 0; i < cloud->n_memb; ++i) { co2_irn_t *ci = (co2_irn_t *) cloud->seq[i]; @@ -1036,7 +1021,6 @@ static void writeback_colors(co2_t *env) static void process(co2_t *env) { - co2_cloud_t *pos; co2_cloud_t **clouds; int n_clouds; int i;