From c221526a38e632139bb36afb3e059b429e76c2d7 Mon Sep 17 00:00:00 2001 From: Thomas Bersch Date: Thu, 26 Nov 2009 11:43:47 +0000 Subject: [PATCH] Interference matrix is now initialized faster [r26745] --- ir/be/becopypbqp.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ir/be/becopypbqp.c b/ir/be/becopypbqp.c index 3638be0c5..92fdcfcf5 100644 --- a/ir/be/becopypbqp.c +++ b/ir/be/becopypbqp.c @@ -186,14 +186,7 @@ static int co_solve_heuristic_pbqp(copy_opt_t *co) { struct pbqp_matrix *ife_matrix = pbqp_matrix_alloc(pbqp_co.pbqp, number_registers, number_registers); /* set costs */ for(row = 0; row < number_registers; row++) { - for(col = 0; col < number_registers; col++) { - if(row == col) { - pbqp_matrix_set(ife_matrix, row, col, INF_COSTS); - } - else { - pbqp_matrix_set(ife_matrix, row, col, 0); - } - } + pbqp_matrix_set(ife_matrix, row, row, INF_COSTS); } /* create costs matrix for affinity edges */ @@ -230,7 +223,7 @@ static int co_solve_heuristic_pbqp(copy_opt_t *co) { if(aff_node != NULL) { co_gs_foreach_neighb(aff_node, aff_neighb_node) { /* ignore Unknowns */ - if(get_node(pbqp_co.pbqp, get_irn_idx(aff_node->irn)) == NULL) + if(get_node(pbqp_co.pbqp, get_irn_idx(aff_neighb_node->irn)) == NULL) continue; if(get_edge(pbqp_co.pbqp, get_irn_idx(aff_node->irn), get_irn_idx(aff_neighb_node->irn)) == NULL) { -- 2.20.1