X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschednormal.c;h=00f2a9e9e52577b8dbc7fa5f5e86dbd3db5351ca;hb=1edb00d5258b7364394b3d2eb4e7b70a22a6ecd0;hp=a7d5d8663cf0cfac04a88ec62bbff362b6c4596f;hpb=ce0f8748151b1be09de1e344a5133bd6759934a1;p=libfirm diff --git a/ir/be/beschednormal.c b/ir/be/beschednormal.c index a7d5d8663..00f2a9e9e 100644 --- a/ir/be/beschednormal.c +++ b/ir/be/beschednormal.c @@ -38,7 +38,7 @@ // XXX there is no one time init for schedulers -//#define NORMAL_DBG +#define NORMAL_DBG static int must_be_scheduled(const ir_node* const irn) @@ -133,13 +133,15 @@ static int normal_tree_cost(ir_node* irn) flag_and_cost* fc = get_irn_link(irn); ir_node* block = get_nodes_block(irn); int arity = get_irn_arity(irn); - int cost_max = 0; - int count_max = 0; int n_res; int cost; int n_op_res = 0; int i; + if (is_Proj(irn)) { + return normal_tree_cost(get_Proj_pred(irn)); + } + if (fc == NULL) { irn_cost_pair* costs; int i; @@ -158,41 +160,24 @@ static int normal_tree_cost(ir_node* irn) cost = 1; } else { flag_and_cost* pred_fc; + ir_node* real_pred; cost = normal_tree_cost(pred); if (be_is_Barrier(pred)) cost = 1; // XXX hack: the barrier causes all users to have a reguse of #regs - pred_fc = get_irn_link(pred); + real_pred = (is_Proj(pred) ? get_Proj_pred(pred) : pred); + pred_fc = get_irn_link(real_pred); pred_fc->no_root = 1; #if defined NORMAL_DBG - ir_fprintf(stderr, "%+F says that %+F is no root\n", irn, pred); + ir_fprintf(stderr, "%+F says that %+F is no root\n", irn, real_pred); #endif } costs[i].irn = pred; costs[i].cost = cost; - - if (cost > cost_max) { - cost_max = cost; - count_max = 1; - } else if (cost == cost_max) { - ++count_max; - } } qsort(costs, arity, sizeof(*costs), cost_cmp); set_irn_link(irn, fc); - } else { - irn_cost_pair* costs = fc->costs; - int i; - - if (arity > 0) { - cost_max = costs[0].cost; - - for (i = 0; i < arity; ++i) { - if (costs[i].cost < cost_max) break; - ++count_max; - } - } } cost = 0;