X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeschedrss.c;h=a7ecc1db48c49c41cbcb3f7994c7aa0fa2364f0f;hb=f2064da88106865885c1d11bec2b37540ee2b274;hp=04261cf50c650a2495a9253f57ab937a9ea74f78;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/beschedrss.c b/ir/be/beschedrss.c index 04261cf50..a7ecc1db4 100644 --- a/ir/be/beschedrss.c +++ b/ir/be/beschedrss.c @@ -18,14 +18,15 @@ */ /** + * @file + * @brief Implementation of a register saturating list scheduler. + * @author Christian Wuerdig + * @date 29.08.2006 + * @version $Id$ + * * Implementation of a register saturating list scheduler * as described in: Sid-Ahmed-Ali Touati * Register Saturation in Superscalar and VLIW Codes - * - * @license This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - * @author Christian Wuerdig - * @date 29.08.2006 - * @cvs-id $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -156,7 +157,7 @@ typedef struct _rss { unsigned max_height; /**< maximum height in the current block */ rss_opts_t *opts; /**< The options */ be_lv_t *liveness; /**< The liveness information for this irg */ - pset *live_block; /**< Values alive at end of block */ + ir_nodeset_t live_block; /**< Values alive at end of block */ const arch_register_class_t *cls; /**< The current register class */ DEBUG_ONLY(firm_dbg_module_t *dbg); } rss_t; @@ -217,7 +218,7 @@ static lc_opt_enum_int_var_t dump_var = { static const lc_opt_table_entry_t rss_option_table[] = { LC_OPT_ENT_ENUM_MASK("dump", "dump phases", &dump_var), - { NULL } + LC_OPT_LAST }; /****************************************************************************** @@ -772,6 +773,7 @@ static int is_potential_killer(rss_t *rss, rss_irn_t *v, rss_irn_t *u) { plist_t *list; ir_node **arr; plist_element_t *el; + (void) rss; assert(is_Sink(v->irn) || ((plist_count(v->descendant_list) > 0 && v->descendants) || 1)); assert(is_Sink(u->irn) || ((plist_count(u->consumer_list) > 0 && u->consumer) || 1)); @@ -2066,8 +2068,8 @@ static void process_block(ir_node *block, void *env) { DBG((rss->dbg, LEVEL_1, "register class %s\n", arch_register_class_name(cls))); /* Get all live value at end of Block having current register class */ - rss->live_block = pset_new_ptr(10); - be_liveness_end_of_block(rss->liveness, rss->arch_env, rss->cls, rss->block, rss->live_block); + ir_nodeset_init(&rss->live_block); + be_liveness_end_of_block(rss->liveness, rss->arch_env, rss->cls, rss->block, &rss->live_block); /* reset the list of interesting nodes */ plist_clear(rss->nodes); @@ -2124,7 +2126,7 @@ static void process_block(ir_node *block, void *env) { */ perform_value_serialization_heuristic(rss); - del_pset(rss->live_block); + ir_nodeset_destroy(&rss->live_block); } phase_free(&rss->ph); @@ -2146,7 +2148,7 @@ BE_REGISTER_MODULE_CONSTRUCTOR(be_init_schedrss); /** * Preprocess the irg for scheduling. */ -void rss_schedule_preparation(const be_irg_t *birg) { +void rss_schedule_preparation(be_irg_t *birg) { ir_graph *irg = be_get_birg_irg(birg); rss_t rss; @@ -2162,7 +2164,8 @@ void rss_schedule_preparation(const be_irg_t *birg) { rss.h = heights_new(irg); rss.nodes = plist_new(); rss.opts = &rss_options; - rss.liveness = be_liveness(irg); + rss.liveness = be_liveness(birg); + be_liveness_assure_sets(rss.liveness); irg_block_walk_graph(irg, NULL, process_block, &rss); heights_free(rss.h); plist_free(rss.nodes);