+ for(irn = sched_next(perm); is_Proj(irn); irn = sched_next(irn)) {
+ arch_register_req_t req;
+
+ if(has_limited_constr(&req, irn)) {
+ bitset_clear_all(bs);
+ req.data.limited(irn, -1, bs);
+ col = bitset_next_set(bs, 0);
+ reg = arch_register_for_index(env->cls, col);
+
+ pset_insert_ptr(alloc_env->pre_colored, irn);
+ arch_set_irn_register(arch_env, irn, reg);
+ bitset_set(colors_used, col);
+
+ DBG((dbg, LEVEL_2, "\tPerm Proj with constraints: %+F set to %s\n", irn, reg->name));
+ }
+
+ else
+ pset_insert_ptr(leftover, irn);
+
+ }
+ cnstr = irn;
+
+ if(has_limited_constr(&req, cnstr)) {
+ bitset_clear_all(bs);
+ req.data.limited(cnstr, -1, bs);
+ col = bitset_next_set(colors_used, 0);
+ reg = arch_register_for_index(env->cls, col);
+
+ arch_set_irn_register(arch_env, cnstr, reg);
+ pset_insert_ptr(alloc_env->pre_colored, cnstr);
+
+ DBG((dbg, LEVEL_2, "\tConstrained node: %+F set to %s\n", irn, reg->name));
+
+ /*
+ * The color of the constrained node must not be used!
+ * The Proj which has been assigned that color might
+ * interfere with the constrained node which leads
+ * to an invalid register allocation.
+ */
+ assert(!bitset_is_set(colors_used, reg->index));
+
+ /*
+ * Look for a Proj not interfering with the constrained node.
+ * This Proj can be safely set to the constrafined nodes
+ * color.
+ */
+ for(irn = pset_first(leftover); irn; irn = pset_next(leftover)) {
+ if(!values_interfere(irn, cnstr)) {
+
+ DBG((dbg, LEVEL_2, "\tFound Proj not interfering with contr node %+F set to %s\n", irn, reg->name));
+ pset_insert_ptr(alloc_env->pre_colored, irn);
+ arch_set_irn_register(arch_env, irn, reg);
+ bitset_set(colors_used, reg->index);
+ pset_remove_ptr(leftover, irn);
+ pset_break(leftover);
+ break;
+ }
+ }
+ }