X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Finterval_analysis.c;h=5919640139b0f6b5513c7f20755e5ef714537294;hb=5f05c97be1452a4fd611648879c1544a8af611c9;hp=36ff2bb667461a3f4d8179385c5f3b249dd3c4fd;hpb=974215da1a935f250766874d0f7a7ddfa34bc4ef;p=libfirm diff --git a/ir/ana/interval_analysis.c b/ir/ana/interval_analysis.c index 36ff2bb66..591964013 100644 --- a/ir/ana/interval_analysis.c +++ b/ir/ana/interval_analysis.c @@ -30,6 +30,7 @@ #include #endif +#include "debug.h" #include "interval_analysis.h" #include "execution_frequency.h" #include "firm_common_t.h" @@ -41,8 +42,11 @@ #include "irdump_t.h" #include "irdom.h" #include "irflag.h" +#include "irprintf.h" #include "hashptr.h" +DEBUG_ONLY(static firm_dbg_module_t *dbg); + /*------------------------------------------------------------------*/ /* A new in array via a hashmap. */ /* The in array refers to the loop the block is contained in if the */ @@ -62,6 +66,7 @@ static set *region_attr_set = NULL; int region_attr_cmp(const void *e1, const void *e2, size_t size) { region_attr *ra1 = (region_attr *)e1; region_attr *ra2 = (region_attr *)e2; + (void) size; return (ra1->reg != ra2->reg); } @@ -190,10 +195,13 @@ static int find_inner_loop(ir_node *b, ir_loop *l, ir_node *pred, ir_node *cfop) } -static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, ir_node *pred_b, ir_node *cfop) { +static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, + ir_node *pred_b, ir_node *cfop) +{ ir_loop *outer = get_loop_outer_loop(l); int found, i; int l_pos = get_loop_element_pos(outer, l); + (void) pred_l; assert(l_pos > -1); assert(l_pos > 0 && "Is this a necessary condition? There could be a perfect nest ..."); @@ -211,14 +219,6 @@ static int find_previous_loop(ir_loop *l, ir_loop *pred_l, ir_node *b, ir_node * } } - if (!found) { - DDMG(current_ir_graph); - DDML(l); - DDML(pred_l); - DDMN(b); - DDMN(pred_b); - } - return found; } @@ -252,9 +252,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) { if (is_backedge(b, i)) { if (b != get_loop_element(l, 0).node) { - if (get_firm_verbosity()) { - printf("Loophead not at loop position 0. "); DDMN(b); - } + DB((dbg, LEVEL_1, "Loophead not at loop position 0. %+F\n", b)); } /* There are no backedges in the interval decomposition. */ add_region_in(b, NULL); @@ -283,9 +281,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) { int found = find_inner_loop(b, l, pred, cfop); if (!found) { if (b != get_loop_element(l, 0).node) { - if (get_firm_verbosity()) { - printf("Loop entry not at loop position 0. "); DDMN(b); - } + DB((dbg, LEVEL_1, "Loop entry not at loop position 0. %+F\n", b)); } found = find_outer_loop(l, pred_l, pred, cfop); if (found) add_region_in(b, NULL); /* placeholder */ @@ -294,9 +290,6 @@ static void construct_interval_block(ir_node *b, ir_loop *l) { found = find_previous_loop(l, pred_l, b, pred, cfop); } if (!found) { - DDMG(current_ir_graph); - DDMN(b); - DDMN(pred); assert(is_backedge(b, i)); assert(found && "backedge from inner loop"); } @@ -305,10 +298,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) { if (b != get_loop_element(l, 0).node) { /* Check for improper region */ if (has_backedges(b)) { - printf("Improper Region!!!!!!\n"); - DDMG(current_ir_graph); - DDMN(b); - DDML(l); + ir_fprintf(stderr, "Improper Region!!!!!! %+F\n", b); } } } @@ -335,6 +325,8 @@ void construct_intervals(ir_graph *irg) { ir_graph *rem = current_ir_graph; current_ir_graph = irg; + FIRM_DBG_REGISTER(dbg, "firm.ana.interval"); + if (!region_attr_set) region_attr_set = new_set(region_attr_cmp, 256); @@ -387,8 +379,7 @@ void dump_region_edges(FILE *F, void *reg) { if (is_ir_node(reg)) { if (get_Block_n_cfgpreds((ir_node *)reg) != get_region_n_ins(reg)) { - printf("n_cfgpreds = %d, n_ins = %d\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg)); - DDMN((ir_node *)reg); + ir_printf("n_cfgpreds = %d, n_ins = %d\n %+F\n", get_Block_n_cfgpreds((ir_node *)reg), get_region_n_ins(reg), (ir_node*) reg); } }