- /* This instruction might create more than one def. These are handled
- by Proj's, find them. */
- foreach_out_edge(irn, edge) {
- p = get_edge_src_irn(edge);
-
- /* did not work if the result is a ProjT. This should NOT happen
- in the backend, but check it for now. */
- assert(get_irn_mode(p) != mode_T);
-
- if (arch_irn_consider_in_reg_alloc(env->cls, p)) {
- /* found a def: create a new operand */
- o.req = arch_get_irn_register_req(p);
- o.carrier = p;
- o.irn = irn;
- o.pos = -(get_Proj_proj(p) + 1);
- o.partner = NULL;
- o.has_constraints = arch_register_req_is(o.req, limited) | (o.req->width > 1);
- obstack_grow(obst, &o, sizeof(o));
- insn->n_ops++;
- insn->out_constraints |= o.has_constraints;
- pre_colored += arch_get_irn_register(p) != NULL;
- }
+ const arch_register_class_t *cls = env->cls;
+ insn->irn = irn;
+ be_foreach_definition(irn, cls, p,
+ /* found a def: create a new operand */
+ arch_register_req_t const *const req = arch_get_irn_register_req(p);
+ if (arch_register_req_is(req, limited)) {
+ o.regs = req->limited;
+ has_constraints = true;
+ } else {
+ o.regs = env->allocatable_regs->data;
+ has_constraints |= req->width > 1;