- obstack_free(env->obst, insn);
- *the_insn = insn = chordal_scan_insn(env, insn->irn);
-
- /*
- * Copy the input constraints of the insn to the Perm as output
- * constraints. Succeeding phases (coalescing) will need that.
- */
- for (i = insn->use_start; i < insn->n_ops; ++i) {
- be_operand_t *op = &insn->ops[i];
- ir_node *proj = op->carrier;
- /*
- * Note that the predecessor must not be a Proj of the Perm,
- * since ignore-nodes are not Perm'ed.
- */
- if (op->has_constraints && is_Proj(proj) && get_Proj_pred(proj) == perm) {
- be_set_constr_out(perm, get_Proj_proj(proj), op->req);
- }
+ obstack_free(&env->obst, insn);
+ *the_insn = insn = be_scan_insn(env, irn);
+
+ /* Copy the input constraints of the irn to the Perm as output
+ * constraints. Succeeding phases (coalescing) will need that. */
+ for (int i = 0, n = get_irn_arity(irn); i != n; ++i) {
+ ir_node *const proj = get_irn_n(irn, i);
+ /* Note that the predecessor is not necessarily a Proj of the Perm,
+ * since ignore-nodes are not Perm'ed. */
+ if (!is_Proj(proj) || get_Proj_pred(proj) != perm)
+ continue;
+ /* FIXME: Only setting the constraints, when the register requirement is
+ * limited, is a hack. It will break when multiple differently constrained
+ * inputs use the same value. */
+ arch_register_req_t const *const req = arch_get_irn_register_req_in(irn, i);
+ if (!arch_register_req_is(req, limited))
+ continue;
+ be_set_constr_out(perm, get_Proj_proj(proj), req);