-#define DBG_MODULE firm_dbg_register("firm.be.irgmod")
-#define DBG_LEVEL SET_LEVEL_0
-
-struct _dom_front_info_t {
- pmap *df_map;
-};
-
-/**
- * A wrapper for get_Block_idom.
- * This function returns the block itself, if the block is the start
- * block. Returning NULL would make any != comparison true which
- * suggests, that the start block is dominated by some other node.
- * @param bl The block.
- * @return The immediate dominator of the block.
- */
-static INLINE ir_node *get_idom(ir_node *bl)
-{
- ir_node *idom = get_Block_idom(bl);
- return idom == NULL ? bl : idom;
-}
-
-static void compute_df(ir_node *n, pmap *df_map)
-{
- ir_node *c;
- const ir_edge_t *edge;
- pset *df = pset_new_ptr_default();
-
- /* Add local dominance frontiers */
- foreach_block_succ(n, edge) {
- ir_node *y = edge->src;
-
- if(get_idom(y) != n)
- pset_insert_ptr(df, y);
- }
-
- /*
- * Go recursively down the dominance tree and add all blocks
- * int the dominance frontiers of the children, which are not
- * dominated by the given block.
- */
- for(c = get_Block_dominated_first(n); c; c = get_Block_dominated_next(c)) {
- pset *df_c;
- ir_node *w;
-
- compute_df(c, df_map);
- df_c = pmap_get(df_map, c);
-
- for(w = pset_first(df_c); w; w = pset_next(df_c)) {
- if(get_idom(w) != n)
- pset_insert_ptr(df, w);
- }
- }
-
- pmap_insert(df_map, n, df);
-
-}
-
-dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg)
-{
- dom_front_info_t *info = malloc(sizeof(*info));