+static int try_pre_color(be_chordal_env_t *env, ir_node *irn,
+ pset *pre_colored, bitset_t *colors_used)
+{
+ arch_register_req_t req;
+
+ if(arch_get_register_req(env->main_env->arch_env, &req, irn, -1)
+ && req.type == arch_register_req_type_limited) {
+
+ bitset_t *bs = bitset_alloca(env->cls->n_regs);
+ const arch_register_t *reg;
+ int col;
+
+ req.data.limited(irn, -1, bs);
+ col = bitset_next_set(bs, 0);
+ reg = arch_register_for_index(env->cls, col);
+
+ pset_insert_ptr(pre_colored, irn);
+ arch_set_irn_register(env->main_env->arch_env, irn, reg);
+
+ bitset_set(colors_used, col);
+
+ DBG((env->dbg, LEVEL_2, "pre coloring %+F with %s\n", irn, reg->name));
+
+ return 1;
+ }
+
+ return 0;
+}
+