Simply return no insn, if it has no constraints.
/* Perms inserted before the constraint handling phase are considered to be
* correctly precolored. These Perms arise during the ABI handling phase. */
- if (!insn->has_constraints || is_Phi(irn))
+ if (!insn || is_Phi(irn))
goto end;
/* Prepare the constraint handling of this node.
ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
{
be_insn_t *insn = *the_insn;
- assert(insn->has_constraints && "only do this for constrained nodes");
/*
* Make the Perm, recompute liveness and re-scan the insn since the
be_insn_t *insn = OALLOCZ(obst, be_insn_t);
+ bool has_constraints = false;
+
insn->irn = irn;
if (get_irn_mode(irn) == mode_T) {
ir_node *p;
o.partner = NULL;
obstack_grow(obst, &o, sizeof(o));
insn->n_ops++;
- insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
+ has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
}
}
} else if (arch_irn_consider_in_reg_alloc(env->cls, irn)) {
o.partner = NULL;
obstack_grow(obst, &o, sizeof(o));
insn->n_ops++;
- insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
+ has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1);
}
insn->use_start = insn->n_ops;
o.partner = NULL;
obstack_grow(obst, &o, sizeof(o));
insn->n_ops++;
- insn->has_constraints |= arch_register_req_is(o.req, limited);
+ has_constraints |= arch_register_req_is(o.req, limited);
}
}
+ if (!has_constraints)
+ return NULL;
+
insn->ops = (be_operand_t*)obstack_finish(obst);
/* Compute the admissible registers bitsets. */
};
struct be_insn_t {
- be_operand_t *ops; /**< the values used and defined by the insn */
- int n_ops; /**< length of the ops array */
- int use_start; /**< entries [0-use_start) in ops are defs,
- [use_start-n_ops) uses */
- ir_node *irn; /**< ir_node of the instruction */
- unsigned has_constraints : 1; /**< in_constraints or out_constraints true */
+ be_operand_t *ops; /**< the values used and defined by the insn */
+ int n_ops; /**< length of the ops array */
+ int use_start; /**< entries [0-use_start) in ops are defs,
+ [use_start-n_ops) uses */
+ ir_node *irn; /**< ir_node of the instruction */
};
/**
for (irn = sched_first(block); !sched_is_end(irn);) {
ir_node *const next = sched_next(irn);
be_insn_t * insn = be_scan_insn(env, irn);
- if (insn->has_constraints)
+ if (insn)
pre_process_constraints(env, &insn);
irn = next;