* often.
* @author Christian Schaefer, Goetz Lindenmaier, Sebastian Felis,
* Michael Beck
- * @version $Id$
*
* The idea here is to push nodes as deep into the dominance tree as their
* dependencies allow. After pushing them back up out of as many loops as
}
block = get_nodes_block(n);
- /* do not move unreachable code (or its predecessors around) since dominance
- * is inalid there */
- if (!is_block_reachable(block))
- return;
/* first move predecessors up */
arity = get_irn_arity(n);
if (is_Bad(new_block))
continue;
- if (is_block_reachable(new_block))
- dca = calc_dom_dca(dca, new_block);
+ assert(is_block_reachable(new_block));
+ dca = calc_dom_dca(dca, new_block);
}
}
} else {
* the users of Proj are our users. */
dca = get_deepest_common_dom_ancestor(succ, dca);
} else {
- /* ignore successors in unreachable code */
- ir_node *succ_blk = get_nodes_block(succ);
- if (!is_block_reachable(succ_blk))
- continue;
+ assert(is_block_reachable(get_nodes_block(succ)));
dca = consumer_dom_dca(dca, succ, node);
}
}
return;
/* some nodes should simply stay in the startblock */
if (is_irn_start_block_placed(n)) {
-#ifndef NDEBUG
- ir_graph *irg = get_irn_irg(n);
- ir_node *start_block = get_irg_start_block(irg);
- assert(get_nodes_block(n) == start_block);
-#endif
+ assert(get_nodes_block(n) == get_irg_start_block(get_irn_irg(n)));
return;
}
- /* don't move unreachable code around */
block = get_nodes_block(n);
- if (!is_block_reachable(block))
- return;
+ assert(is_block_reachable(block));
/* deepest common ancestor in the dominator tree of all nodes'
blocks depending on us; our final placement has to dominate
{
waitq *worklist;
- remove_critical_cf_edges(irg);
-
/* Handle graph state */
assert(get_irg_phase_state(irg) != phase_building);
- assure_irg_outs(irg);
- assure_doms(irg);
- assure_cf_loop(irg);
+ assure_irg_properties(irg,
+ IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES |
+ IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE |
+ IR_GRAPH_PROPERTY_CONSISTENT_OUTS |
+ IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE |
+ IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
/* Place all floating nodes as early as possible. This guarantees
a legal code placement. */
worklist = new_waitq();
place_early(irg, worklist);
+ /* While GCSE might place nodes in unreachable blocks,
+ * these are now placed in reachable blocks. */
+
/* Note: place_early changes only blocks, no data edges. So, the
* data out edges are still valid, no need to recalculate them here. */
place_late(irg, worklist);
del_waitq(worklist);
+ confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
}
/**