X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeloopana.c;h=b5f106fe8ce3bd84f73014cd8b019bbf78a530b1;hb=ee5425ca1c172c4cf244de9864f8fd44ad2cb645;hp=9c33d76737a42cdb9bce2085a56b83160b9139ac;hpb=9e31d4eab3ffb00fae7791ed224ea27fbca2eade;p=libfirm diff --git a/ir/be/beloopana.c b/ir/be/beloopana.c index 9c33d7673..b5f106fe8 100644 --- a/ir/be/beloopana.c +++ b/ir/be/beloopana.c @@ -22,14 +22,13 @@ * @brief Compute register pressure in loops. * @author Christian Wuerdig * @date 19.02.2007 - * @version $Id$ */ #include "config.h" #include "set.h" #include "pset.h" #include "irnode.h" -#include "irtools.h" +#include "util.h" #include "irloop_t.h" #include "error.h" #include "debug.h" @@ -40,7 +39,7 @@ #include "beloopana.h" #include "bemodule.h" -DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL); +DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) #define HASH_LOOP_INFO(info) (HASH_PTR((info)->loop) ^ HASH_PTR((info)->cls)) @@ -105,7 +104,7 @@ static unsigned be_compute_block_pressure(const ir_graph *irg, } /** - * Compute the highest register pressure in a loop and it's sub-loops. + * Compute the highest register pressure in a loop and its sub-loops. * @param loop_ana The loop ana object. * @param loop The loop to compute pressure for. * @param cls The register class to compute pressure for. @@ -166,10 +165,7 @@ be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg, DBG((dbg, LEVEL_1, " Computing register pressure for class %s:\n", cls->name)); DBG((dbg, LEVEL_1, "=====================================================\n", cls->name)); - /* construct control flow loop tree */ - if (! (get_irg_loopinfo_state(irg) & loopinfo_cf_consistent)) { - construct_cf_backedges(irg); - } + assure_loopinfo(irg); be_compute_loop_pressure(loop_ana, get_irg_loop(irg), cls); @@ -192,10 +188,7 @@ be_loopana_t *be_new_loop_pressure(ir_graph *irg, loop_ana->data = new_set(cmp_loop_info, 16); loop_ana->irg = irg; - /* construct control flow loop tree */ - if (! (get_irg_loopinfo_state(irg) & loopinfo_cf_consistent)) { - construct_cf_backedges(irg); - } + assure_loopinfo(irg); if (cls != NULL) { be_compute_loop_pressure(loop_ana, irg_loop, cls); @@ -244,7 +237,7 @@ void be_free_loop_pressure(be_loopana_t *loop_ana) xfree(loop_ana); } -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_loopana); +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_loopana) void be_init_loopana(void) { FIRM_DBG_REGISTER(dbg, "firm.be.loopana");