+ bitset_t *visited = bitset_irg_malloc(irg);
+
+ irg_live_info_t *live_info = get_irg_live_info(irg);
+ if(live_info->live)
+ del_set(live_info->live);
+
+ live_info->live = new_set(cmp_irn_live, 8192);
+ irg_walk_graph(irg, liveness_for_node, NULL, visited);
+
+ old_dump_block_func = op_Block->ops.dump_node;
+ op_Block->ops.dump_node = dump_block_func;
+
+ bitset_free(visited);
+}
+
+/**
+ * Pre-walker: dump liveness data to a file
+ */
+static void dump_liveness_walker(ir_node *bl, void *data)
+{
+ FILE *f = data;
+ const irn_live_t *li;
+ char buf[64];
+
+ ir_fprintf(f, "%+F\n", bl);
+ live_foreach(bl, li) {
+ strcpy(buf, "");
+
+ if(live_is_in(li))
+ strcat(buf, "in ");
+
+ if(live_is_end(li))
+ strcat(buf, "end ");
+
+ if(live_is_out(li))
+ strcat(buf, "out ");
+
+ ir_fprintf(f, "\t%+20F %s\n", li->irn, buf);
+ }
+}
+
+/* Dump the liveness information for a graph. */
+void be_liveness_dump(ir_graph *irg, FILE *f)
+{
+ irg_block_walk_graph(irg, dump_liveness_walker, NULL, f);
+}
+
+/* Dump the liveness information for a graph. */
+void be_liveness_dumpto(ir_graph *irg, const char *cls_name)
+{
+ FILE *f;
+ char buf[128];
+ ir_snprintf(buf, sizeof(buf), "%F_%s-live.txt", irg, cls_name);
+ if((f = fopen(buf, "wt")) != NULL) {
+ be_liveness_dump(irg, f);
+ fclose(f);
+ }
+}
+
+/**
+ * Walker: checks the every predecessors of a node dominate
+ * the note.
+ */
+static void dom_check(ir_node *irn, void *data)
+{
+ if(!is_Block(irn) && irn != get_irg_end(get_irn_irg(irn))) {
+ int i, n;
+ ir_node *bl = get_nodes_block(irn);
+
+ for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
+ ir_node *op = get_irn_n(irn, i);
+ ir_node *def_bl = get_nodes_block(op);
+ ir_node *use_bl = bl;
+
+ if(is_Phi(irn))
+ use_bl = get_Block_cfgpred_block(bl, i);
+
+ if(!block_dominates(def_bl, use_bl)) {
+ ir_fprintf(stderr, "%+F in %+F must dominate %+F for user %+F\n", op, def_bl, use_bl, irn);
+ assert(0);
+ }
+ }
+ }
+}
+
+/* Check, if the SSA dominance property is fulfilled. */
+void be_check_dominance(ir_graph *irg)
+{
+ irg_walk_graph(irg, dom_check, NULL, NULL);