return get_Block_dom_depth(block) >= 0;
}
-/* mark node as not-visited */
-static void clear_irn_visited(ir_node *node)
-{
- ir_graph *irg = get_irn_irg(node);
- ir_visited_t visited = get_irg_visited(irg);
- set_irn_visited(node, visited-1);
-}
-
/**
* Find the earliest correct block for node n. --- Place n into the
* same Block as its dominance-deepest Input.
}
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);
place_floats_early(block, worklist);
for (i = 0; i < arity; ++i) {
- ir_node *pred = get_irn_n(n, i);
- ir_node *pred_block = get_nodes_block(pred);
-
- /* gcse can lead to predecessors of reachable code being unreachable.
- * Move them into the current block in this case */
- if (!is_block_reachable(pred_block)) {
- ir_node *new_pred_block = block;
- assert(get_irn_pinned(pred) == op_pin_state_floats);
- if (is_Phi(n)) {
- new_pred_block = get_Block_cfgpred_block(block, i);
- }
- set_nodes_block(pred, new_pred_block);
- clear_irn_visited(pred);
- }
+ ir_node *pred = get_irn_n(n, i);
place_floats_early(pred, worklist);
}
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;
}
- /* 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
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. */
unnecessary executions of the node. */
place_late(irg, worklist);
- set_irg_outs_inconsistent(irg);
- set_irg_loopinfo_inconsistent(irg);
del_waitq(worklist);
}