#define DEBUG_LVL 0 //(DBG_START | DBG_DECIDE | DBG_WSETS | DBG_FIX | DBG_SPILL)
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
typedef struct _workset_t workset_t;
typedef struct _belady_env_t {
}
DBG((dbg, DBG_DECIDE, " demand = %d\n", demand));
-
/*
* 2. Make room for at least 'demand' slots
*/
before its first usage, remove it from start workset */
for (i=max_allowed; i<ws->len; ++i) {
ir_node *irn = ws->vals[i].irn;
+
if (!pset_find_ptr(bel->used, irn)) {
ir_node *curr_bb = get_nodes_block(bel->instr);
workset_t *ws_start = get_block_info(curr_bb)->ws_start;
static void remove_copies(belady_env_t *bel) {
ir_node *irn;
- for (irn = pset_first(bel->copies); irn; irn = pset_next(bel->copies)) {
+ foreach_pset(bel->copies, irn) {
ir_node *src, *user;
assert(be_is_Copy(irn));
ir_node *irn;
irg_walk_graph(irg, rescue_used_reloads, NULL, bel->reloads);
- for(irn = pset_first(bel->reloads); irn; irn = pset_next(bel->reloads)) {
+ foreach_pset(bel->reloads, irn) {
ir_node *spill;
DBG((dbg, DBG_SPILL, "Removing %+F before %+F in %+F\n", irn, sched_next(irn), get_nodes_block(irn)));