X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Finterval_analysis.c;h=50702008219913a97ca942c8e14b1b6167626626;hb=2c4676f64fa3e89b1442c09869fee8998a832508;hp=26a362efd85d476a047599f7580cd6e61224fe89;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/ana/interval_analysis.c b/ir/ana/interval_analysis.c index 26a362efd..507020082 100644 --- a/ir/ana/interval_analysis.c +++ b/ir/ana/interval_analysis.c @@ -1,4 +1,27 @@ +/* + * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. + * + * This file may be distributed and/or modified under the terms of the + * GNU General Public License version 2 as published by the Free Software + * Foundation and appearing in the file LICENSE.GPL included in the + * packaging of this file. + * + * Licensees holding valid libFirm Professional Edition licenses may use + * this file in accordance with the libFirm Commercial License. + * Agreement provided with the Software. + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. + */ +/** + * @file + * @brief Implementation of interval analysis + * @version $Id$ + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -18,6 +41,7 @@ #include "irdump_t.h" #include "irdom.h" #include "irflag.h" +#include "irprintf.h" #include "hashptr.h" /*------------------------------------------------------------------*/ @@ -39,6 +63,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); } @@ -167,10 +192,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 ..."); @@ -188,14 +216,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; } @@ -230,7 +250,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); + ir_printf("Loophead not at loop position 0. %+F\n", b); } } /* There are no backedges in the interval decomposition. */ @@ -261,7 +281,7 @@ static void construct_interval_block(ir_node *b, ir_loop *l) { if (!found) { if (b != get_loop_element(l, 0).node) { if (get_firm_verbosity()) { - printf("Loop entry not at loop position 0. "); DDMN(b); + ir_printf("Loop entry not at loop position 0. %+F\n", b); } } found = find_outer_loop(l, pred_l, pred, cfop); @@ -271,9 +291,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"); } @@ -282,10 +299,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); } } } @@ -364,8 +378,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); } }