- for(p = sched_next(irn); is_Proj(p); p = sched_next(p)) {
- if(arch_irn_consider_in_reg_alloc(arch_env, env->cls, p)) {
- arch_get_register_req(arch_env, &o.req, p, -1);
+ /* 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 */
+ 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;
+ }