+
+ /* we shouldn't have copies from 1 value to multiple destinations left*/
+ assert(n_used[old_r] == 1);
+
+ /* exchange old_r and r2; after that old_r is a fixed point */
+ r2 = permutation[old_r];
+
+ in[0] = ins[r2];
+ in[1] = ins[old_r];
+ perm = be_new_Perm(cls, block, 2, in);
+
+ proj0 = new_r_Proj(block, perm, get_irn_mode(in[0]), 0);
+ link_to(proj0, in[0]);
+ reg = arch_register_for_index(cls, old_r);
+ use_reg(proj0, reg);
+
+ proj1 = new_r_Proj(block, perm, get_irn_mode(in[1]), 1);
+
+ /* 1 value is now in the correct register */
+ permutation[old_r] = old_r;
+ /* the source of r changed to r2 */
+ permutation[r] = r2;
+ ins[r2] = in[1];
+ reg = arch_register_for_index(cls, r2);
+ if (r == r2) {
+ /* if we have reached a fixpoint update data structures */
+ link_to(proj1, in[1]);
+ use_reg(proj1, reg);
+ } else {
+ arch_set_irn_register(proj1, reg);
+ }
+ }
+
+#ifdef DEBUG_libfirm
+ /* now we should only have fixpoints left */
+ for (r = 0; r < n_regs; ++r) {
+ assert(permutation[r] == r);