- DBG((dbg, LEVEL_3, "dom front of %+F\n", bl));
- for(y = pset_first(df); y; y = pset_next(df))
- DBG((dbg, LEVEL_3, "\t%+F\n", y));
-
- for(y = pset_first(df); y; y = pset_next(df)) {
- if(!pset_find_ptr(phi_blocks, y)) {
- pset_insert_ptr(phi_blocks, y);
-
- /*
- * Clear the link field of a possible phi block, since
- * the possibly created phi will be stored there. See,
- * search_def()
- */
- set_irn_link(y, NULL);
-
- if(!pset_find_ptr(copy_blocks, y))
- pdeq_putr(worklist, y);
-
- }
- }
+ DBG((dbg, LEVEL_1, "live:\n"));
+ i = 0;
+ foreach_ir_nodeset(&live, irn, iter) {
+ DBG((dbg, LEVEL_1, "\t%+F\n", irn));
+ nodes[i] = irn;
+ i++;
+ }
+ ir_nodeset_destroy(&live);
+
+ perm = be_new_Perm(cls, irg, bl, n, nodes);
+ sched_add_after(pos, perm);
+ free(nodes);
+
+ curr = perm;
+ for (i = 0; i < n; ++i) {
+ ir_node *perm_op = get_irn_n(perm, i);
+ const arch_register_t *reg = arch_get_irn_register(arch_env, perm_op);
+ be_ssa_construction_env_t senv;
+
+ ir_mode *mode = get_irn_mode(perm_op);
+ ir_node *proj = new_r_Proj(irg, bl, perm, mode, i);
+ arch_set_irn_register(arch_env, proj, reg);
+
+ curr = proj;
+
+ be_ssa_construction_init(&senv, birg);
+ be_ssa_construction_add_copy(&senv, perm_op);
+ be_ssa_construction_add_copy(&senv, proj);
+ be_ssa_construction_fix_users(&senv, perm_op);
+ be_ssa_construction_update_liveness_phis(&senv, lv);
+ be_liveness_update(lv, perm_op);
+ be_liveness_update(lv, proj);
+ be_ssa_construction_destroy(&senv);