+static void
+walker_regclass_copy_insertor(ir_node * irn, void * data)
+{
+ spill_ilp_t *si = data;
+
+ if(is_Phi(irn) && has_reg_class(si, irn)) {
+ int n;
+
+ for(n=get_irn_arity(irn)-1; n>=0; --n) {
+ ir_node *phi_arg = get_irn_n(irn, n);
+ ir_node *bb = get_Block_cfgpred_block(get_nodes_block(irn), n);
+
+ if(!has_reg_class(si, phi_arg)) {
+ ir_node *copy = be_new_Copy(si->cls, si->chordal_env->irg, bb, phi_arg);
+ ir_node *pos = sched_block_last_noncf(si, bb);
+ op_t *op = obstack_alloc(si->obst, sizeof(*op));
+
+ DBG((si->dbg, LEVEL_2, "\t copy to my regclass for arg %+F of %+F\n", phi_arg, irn));
+ sched_add_after(pos, copy);
+ set_irn_n(irn, n, copy);
+
+ op->is_remat = 0;
+ op->attr.live_range.args.reloads = NULL;
+ op->attr.live_range.ilp = ILP_UNDEF;
+ set_irn_link(copy, op);
+ }
+ }
+ }
+}
+
+