+
+struct _elr_closure_t {
+ struct obstack obst;
+ const be_chordal_env_t *cenv;
+};
+
+static void elr_split_walker(ir_node *bl, void *data)
+{
+ struct _elr_closure_t *c = data;
+ const be_chordal_env_t *cenv = c->cenv;
+ const arch_env_t *aenv = cenv->birg->main_env->arch_env;
+ be_insn_t *insn;
+ be_insn_env_t ie;
+
+ be_insn_env_init(&ie, cenv->birg, cenv->cls, &c->obst);
+
+ for(insn = be_scan_insn(&ie, sched_first(bl)); !is_Block(insn->irn); insn = be_scan_insn(&ie, insn->next_insn)) {
+ ir_node *pred = sched_prev(insn->irn);
+ ir_printf("curr: %+F next: %+F, prev: %+F\n", insn->irn, insn->next_insn, pred);
+ if(!is_Block(pred) && !is_Phi(insn->irn))
+ insert_Perm_after(aenv, cenv->lv, cenv->cls, cenv->dom_front, insn->irn);
+ }
+}
+
+void extreme_liverange_splitting(struct _be_chordal_env_t *cenv)
+{
+ struct _elr_closure_t c;
+
+ c.cenv = cenv;
+ obstack_init(&c.obst);
+ be_liveness_recompute(cenv->lv);
+ irg_block_walk_graph(cenv->irg, elr_split_walker, NULL, &c);
+ be_liveness_recompute(cenv->lv);
+ obstack_free(&c.obst, NULL);
+}