- for (i = 0, n = get_irn_arity(irn); i < n; ++i) {
- ir_node *op = get_irn_n(irn, i);
-
- if (arch_irn_consider_in_reg_alloc(env->cls, op)) {
- /* found a register use, create an operand */
- o.req = arch_get_irn_register_req_in(irn, i);
- o.carrier = op;
- o.irn = irn;
- o.pos = i;
- o.partner = NULL;
- o.has_constraints = arch_register_req_is(o.req, limited);
- obstack_grow(obst, &o, sizeof(o));
- insn->n_ops++;
- insn->has_constraints |= o.has_constraints;
- }
- }
-
- insn->ops = (be_operand_t*)obstack_finish(obst);
-
- /* Compute the admissible registers bitsets. */
- for (i = 0; i < insn->n_ops; ++i) {
- be_operand_t *op = &insn->ops[i];
- const arch_register_req_t *req = op->req;
- const arch_register_class_t *cls = req->cls;
- arch_register_req_type_t type = req->type;
-
- /* If there is no special requirement, we allow current class here */
- if (cls == NULL && req->type == arch_register_req_type_none) {
- cls = env->cls;
- type = arch_register_req_type_normal;
- }
-
- assert(cls == env->cls);
-
- if (type & arch_register_req_type_limited) {
- bitset_t *regs = bitset_obstack_alloc(obst, env->cls->n_regs);
- rbitset_copy_to_bitset(req->limited, regs);
- op->regs = regs;
+ be_foreach_use(irn, cls, in_req, op, op_req,
+ /* found a register use, create an operand */
+ if (arch_register_req_is(in_req, limited)) {
+ o.regs = in_req->limited;
+ has_constraints = true;