+
+ if (is_pinned(arg)) {
+ /*
+ Insert a duplicate of the original value in arguments block,
+ make it the new phi arg,
+ set its register,
+ insert it into schedule,
+ pin it
+ */
+ ir_node *perm = get_Proj_pred(arg);
+ ir_node *dupl = be_new_Copy(arg_block, arg);
+ ir_node *ins;
+
+ set_irn_n(phi, i, dupl);
+ arch_set_irn_register(dupl, phi_reg);
+ /* skip the Perm's Projs and insert the copies behind. */
+ for (ins = sched_next(perm); is_Proj(ins); ins = sched_next(ins)) {
+ }
+ sched_add_before(ins, dupl);
+ pin_irn(dupl, phi_block);
+ be_liveness_introduce(lv, dupl);
+ be_liveness_update(lv, arg);
+ DBG((dbg, LEVEL_1, " arg is pinned: insert %+F(%s)\n", dupl, arch_get_irn_register(dupl)->name));
+ } else {
+ /*
+ No other phi has the same color (else arg would have been pinned),
+ so just set the register and pin
+ */
+ arch_set_irn_register(arg, phi_reg);
+ pin_irn(arg, phi_block);
+ DBG((dbg, LEVEL_1, " arg is not pinned: so pin %+F(%s)\n", arg, arch_get_irn_register(arg)->name));
+ }