-#if 0
-/* there is a bug in this code */
-static void
-compute_dominance_frontier_old (MonoCompile *m) {
- int i, j, bitsize;
- MonoBasicBlock **postorder;
- MonoBasicBlock *bb, *z;
- char *mem;
-
- g_assert (!(m->comp_done & MONO_COMP_DFRONTIER));
-
- postorder = mono_mempool_alloc (m->mempool, sizeof (MonoBasicBlock*) * m->num_bblocks);
- i = 0;
- postorder_visit (m->bb_entry, &i, postorder);
- /*g_print ("postorder traversal:");
- for (i = 0; i < m->num_bblocks; ++i)
- g_print (" B%d", postorder [i]->dfn);
- g_print ("\n");*/
-
- /* we could reuse the bitsets allocated in compute_idominators() */
- bitsize = mono_bitset_alloc_size (m->num_bblocks, 0);
- mem = mono_mempool_alloc0 (m->mempool, bitsize * m->num_bblocks);
-
- for (i = 0; i < m->num_bblocks; ++i) {
- bb = postorder [i];
- bb->dfrontier = mono_bitset_mem_new (mem, m->num_bblocks, 0);
- mem += bitsize;
- }
- for (i = 0; i < m->num_bblocks; ++i) {
- bb = postorder [i];
- /* the local component */
- for (j = 0; j < bb->out_count; ++j) {
- //if (bb->out_bb [j] != bb->idom)
- if (bb->out_bb [j]->idom != bb)
- mono_bitset_set (bb->dfrontier, bb->out_bb [j]->dfn);
- }
- }
- for (i = 0; i < m->num_bblocks; ++i) {
- bb = postorder [i];
- /* the up component */
- if (bb->idom) {
- z = bb->idom;
- mono_bitset_foreach_bit (z->dfrontier, j, m->num_bblocks) {
- //if (m->bblocks [j] != bb->idom)
- if (m->bblocks [j]->idom != bb)
- mono_bitset_set (bb->dfrontier, m->bblocks [j]->dfn);
- }
- }
- }
-
- /* this is a check for the dominator frontier */
- for (i = 0; i < m->num_bblocks; ++i) {
- MonoBasicBlock *x = m->bblocks [i];
-
- mono_bitset_foreach_bit ((x->dfrontier), j, (m->num_bblocks)) {
- MonoBasicBlock *w = m->bblocks [j];
- int k;
- /* x must not strictly dominates w */
- if (mono_bitset_test_fast (w->dominators, x->dfn) && w != x)
- g_assert_not_reached ();
-
- for (k = 0; k < m->num_bblocks; ++k)
- m->bblocks [k]->flags &= ~BB_VISITED;
-
- check_dominance_frontier (x, x);
- }
- }
-
- m->comp_done |= MONO_COMP_DFRONTIER;
-}