struct _be_uses_t {
set *uses;
ir_graph *irg;
- firm_dbg_module_t *dbg;
const arch_env_t *arch_env;
+ DEBUG_ONLY(firm_dbg_module_t *dbg;)
};
-
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
static INLINE unsigned sadd(unsigned a, unsigned b)
{
return a + b;
be_use_t *u;
u = get_or_set_use(uses, bl, def, 0);
- if(!u->is_set) {
+ if (! u->is_set) {
u->is_set = 1;
u->next_use = USES_INFINITY;
u->next_use = be_get_next_use(uses, sched_first(bl), 0, def, 0);
sched_foreach_from(from, irn) {
int i, n;
- if(!skip_from_uses) {
- for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
+ if (! skip_from_uses) {
+ for (i = 0, n = get_irn_arity(irn); i < n; ++i) {
ir_node *operand = get_irn_n(irn, i);
- if(operand == def) {
+ if (operand == def) {
DBG((uses->dbg, LEVEL_3, "found use of %+F at %+F\n", operand, irn));
return step;
}
step++;
}
+ /* FIXME: quick and dirty hack to prevent ignore nodes (like stack pointer) from being spilled */
+ return is_live_end(bl, def) ? step : USES_INFINITY;
+
next_use = USES_INFINITY;
foreach_block_succ(bl, succ_edge) {
const ir_node *succ_bl = succ_edge->src;
uses->arch_env = arch_env;
uses->uses = new_set(cmp_use, 512);
- uses->dbg = firm_dbg_register("be.uses");
uses->irg = irg;
- firm_dbg_set_mask(uses->dbg, DBG_LEVEL);
+ FIRM_DBG_REGISTER(uses->dbg, "firm.be.uses");
return uses;
}