#include "besched_t.h"
#include "be_t.h"
+#ifndef NDEBUG
#define EXPENSIVE_CHECKS
+#endif
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
struct worklist_t {
struct list_head live_values;
size_t n_live_values;
- unsigned long visited;
+ ir_visited_t visited;
};
typedef struct block_info_t block_info_t;
worklist_t *end_worklist;
};
-static const arch_env_t *arch_env;
static const arch_register_class_t *cls;
static struct obstack obst;
static spill_env_t *senv;
static bool should_have_reached_fixpoint;
static bool do_push_unused_livethroughs;
static ir_exec_freq *exec_freq;
-static unsigned long worklist_visited;
+static ir_visited_t worklist_visited;
static worklist_t *new_worklist(void)
{
value = get_Phi_pred(value, succ_pos);
/* can happen for unknown phi preds */
- if (!arch_irn_consider_in_reg_alloc(arch_env, cls, value))
+ if (!arch_irn_consider_in_reg_alloc(cls, value))
continue;
}
- if (irn_visited(value))
+ if (irn_visited_else_mark(value))
continue;
new_entry = obstack_alloc(&obst, sizeof(new_entry[0]));
list_add_tail(&new_entry->head, &new_worklist->live_values);
++n_live_values;
- mark_irn_visited(value);
set_irn_link(value, new_entry);
new_worklist->n_live_values++;
}
/* already in the worklist? move around, otherwise add at back */
worklist_entry_t *entry = get_irn_link(value);
- assert(arch_irn_consider_in_reg_alloc(arch_env, cls, value));
+ assert(arch_irn_consider_in_reg_alloc(cls, value));
if (worklist_contains(value)) {
assert(entry != NULL);
if (worklist_contains(node2))
continue;
- if (!arch_irn_consider_in_reg_alloc(arch_env, cls, node2))
+ if (!arch_irn_consider_in_reg_alloc(cls, node2))
continue;
if (!tentative_mode)
foreach_out_edge(node, edge) {
ir_node *proj = get_edge_src_irn(edge);
- if (!arch_irn_consider_in_reg_alloc(arch_env, cls, proj))
+ if (!arch_irn_consider_in_reg_alloc(cls, proj))
continue;
if (worklist_contains(proj)) {
worklist_remove(worklist, proj);
++n_defs;
}
}
- } else if (arch_irn_consider_in_reg_alloc(arch_env, cls, node)) {
+ } else if (arch_irn_consider_in_reg_alloc(cls, node)) {
if (worklist_contains(node)) {
worklist_remove(worklist, node);
} else {
for(i = 0; i < arity; ++i) {
ir_node *use = get_irn_n(node, i);
- if (!arch_irn_consider_in_reg_alloc(arch_env, cls, use))
+ if (!arch_irn_consider_in_reg_alloc(cls, use))
continue;
val_used(worklist, use, node);
}
assert(found);
}
+#else
+ (void) entry;
#endif
+
/* check all loop successors */
for (edge = loop_info->exit_edges; edge != NULL; edge = edge->next) {
ir_node *succ = edge->block;
value = get_irn_n(value, i);
/* we might have unknowns as argument for the phi */
- if (!arch_irn_consider_in_reg_alloc(arch_env, cls, value))
+ if (!arch_irn_consider_in_reg_alloc(cls, value))
continue;
}
return;
worklist_visited = 0;
- arch_env = be_get_birg_arch_env(birg);
exec_freq = be_get_birg_exec_freq(birg);
be_clear_links(irg);