X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbelive.c;h=8a81f54dcc9d9817e039d37c2740b05674fca017;hb=040868cbcb834457c8195efbbccf221123c7f153;hp=644316e65705cbc4a431fbedebd51282dc494b7b;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/ir/be/belive.c b/ir/be/belive.c index 644316e65..8a81f54dc 100644 --- a/ir/be/belive.c +++ b/ir/be/belive.c @@ -525,7 +525,7 @@ static void compute_liveness(be_lv_t *lv) /* * inserting the variables sorted by their ID is probably * more efficient since the binary sorted set insertion - * will not need to move arounf the data. + * will not need to move around the data. * However, if sorting the variables a priori pays off * needs to be checked, hence the define. */ @@ -547,17 +547,23 @@ static void compute_liveness(be_lv_t *lv) void be_liveness_assure_sets(be_lv_t *lv) { if (!lv->nodes) { + BE_TIMER_PUSH(t_live); + lv->nodes = bitset_malloc(2 * get_irg_last_idx(lv->irg)); phase_init(&lv->ph, "liveness", lv->irg, PHASE_DEFAULT_GROWTH, lv_phase_data_init, NULL); compute_liveness(lv); /* be_live_chk_compare(lv, lv->lvc); */ + + BE_TIMER_POP(t_live); } } void be_liveness_assure_chk(be_lv_t *lv) { #ifndef USE_LIVE_CHK + BE_TIMER_PUSH(t_verify); be_liveness_assure_sets(lv); + BE_TIMER_POP(t_verify); #else (void) lv; #endif @@ -593,25 +599,32 @@ be_lv_t *be_liveness(const be_irg_t *birg) void be_liveness_recompute(be_lv_t *lv) { - unsigned last_idx = get_irg_last_idx(lv->irg); + unsigned last_idx; + + BE_TIMER_PUSH(t_live); + last_idx = get_irg_last_idx(lv->irg); if(last_idx >= bitset_size(lv->nodes)) { bitset_free(lv->nodes); lv->nodes = bitset_malloc(last_idx * 2); - } - - else + } else bitset_clear_all(lv->nodes); phase_free(&lv->ph); phase_init(&lv->ph, "liveness", lv->irg, PHASE_DEFAULT_GROWTH, lv_phase_data_init, NULL); compute_liveness(lv); + + BE_TIMER_POP(t_live); } void be_liveness_free(be_lv_t *lv) { be_liveness_invalidate(lv); - free(lv); +#ifdef USE_LIVE_CHK + lv_chk_free(lv->lvc); + dfs_free(lv->dfs); +#endif + xfree(lv); } void be_liveness_remove(be_lv_t *lv, const ir_node *irn) @@ -795,9 +808,7 @@ void be_liveness_transfer(const arch_env_t *arch_env, ir_nodeset_remove(nodeset, proj); } } - } - - if (arch_irn_consider_in_reg_alloc(arch_env, cls, node)) { + } else if (arch_irn_consider_in_reg_alloc(arch_env, cls, node)) { ir_nodeset_remove(nodeset, node); }