X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbepbqpcoloring.c;h=c658814ae6087b4409434ff6b112e40e7a34bc74;hb=df4c51eeaf2d8fef85c97c284595087a4d11e0af;hp=0d67d4c7994ff8183a497c862ed4df80d9a3dbf3;hpb=369cb4e1554b2088eecc48bc95de8e42f33b4328;p=libfirm diff --git a/ir/be/bepbqpcoloring.c b/ir/be/bepbqpcoloring.c index 0d67d4c79..c658814ae 100644 --- a/ir/be/bepbqpcoloring.c +++ b/ir/be/bepbqpcoloring.c @@ -155,7 +155,10 @@ static void create_pbqp_node(be_pbqp_alloc_env_t *pbqp_alloc_env, ir_node *irn) /* set costs depending on register constrains */ unsigned idx; for (idx = 0; idx < colors_n; idx++) { - if (!bitset_is_set(allocatable_regs, idx) || !arch_reg_out_is_allocatable(irn, arch_register_for_index(cls, idx))) { + const arch_register_req_t *req = arch_get_irn_register_req(irn); + const arch_register_t *reg = arch_register_for_index(cls, idx); + if (!bitset_is_set(allocatable_regs, idx) + || !arch_reg_is_allocatable(req, reg)) { /* constrained */ vector_set(costs_vector, idx, INF_COSTS); cntConstrains++; @@ -259,7 +262,7 @@ static void create_affinity_edges(ir_node *irn, void *env) { be_pbqp_alloc_env_t *pbqp_alloc_env = (be_pbqp_alloc_env_t*)env; const arch_register_class_t *cls = pbqp_alloc_env->cls; - const arch_register_req_t *req = arch_get_register_req_out(irn); + const arch_register_req_t *req = arch_get_irn_register_req(irn); unsigned pos; unsigned max; @@ -621,7 +624,11 @@ static void be_pbqp_coloring(be_chordal_env_t *env) be_pbqp_alloc_env_t pbqp_alloc_env; unsigned col; unsigned row; - + pbqp_matrix_t *ife_matrix; + num solution; +#if KAPS_DUMP + FILE *file_before; +#endif #if TIMER ir_timer_t *t_ra_pbqp_alloc_create = ir_timer_new(); ir_timer_t *t_ra_pbqp_alloc_solve = ir_timer_new(); @@ -659,7 +666,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env) /* create costs matrix template for interference edges */ - pbqp_matrix_t *ife_matrix = pbqp_matrix_alloc(pbqp_alloc_env.pbqp_inst, colors_n, colors_n); + ife_matrix = pbqp_matrix_alloc(pbqp_alloc_env.pbqp_inst, colors_n, colors_n); /* set costs */ for (row = 0, col = 0; row < colors_n; row++, col++) pbqp_matrix_set(ife_matrix, row, col, INF_COSTS); @@ -709,18 +716,20 @@ static void be_pbqp_coloring(be_chordal_env_t *env) #if KAPS_DUMP // dump graph before solving pbqp - FILE *file_before = my_open(env, "", "-pbqp_coloring.html"); + file_before = my_open(env, "", "-pbqp_coloring.html"); set_dumpfile(pbqp_alloc_env.pbqp_inst, file_before); #endif - /* print out reverse perfect eleminiation order */ + /* print out reverse perfect elimination order */ #if PRINT_RPEO - plist_element_t *elements; - foreach_plist(pbqp_alloc_env.rpeo, elements) { - pbqp_node_t *node = elements->data; - printf(" %d(%lu);", node->index, get_idx_irn(irg, node->index)->node_nr); + { + plist_element_t *elements; + foreach_plist(pbqp_alloc_env.rpeo, elements) { + pbqp_node_t *node = elements->data; + printf(" %d(%ld);", node->index, get_idx_irn(irg, node->index)->node_nr); + } + printf("\n"); } - printf("\n"); #endif /* solve pbqp instance */ @@ -738,7 +747,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env) #endif - num solution = get_solution(pbqp_alloc_env.pbqp_inst); + solution = get_solution(pbqp_alloc_env.pbqp_inst); if (solution == INF_COSTS) panic("No PBQP solution found"); @@ -779,7 +788,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env) /** * Initializes this module. */ -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pbqp_coloring); +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pbqp_coloring) void be_init_pbqp_coloring(void) { lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");