Commit 45cfa914 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

bechordal: Process Phis before live-in nodes again.

Add a comment, why this is an important property.
parent 0ac0b440
......@@ -87,9 +87,6 @@ void create_borders(ir_node *block, void *env_ptr)
* relevant for the interval borders.
*/
sched_foreach_reverse(block, irn) {
if (is_Phi(irn))
break;
DB((dbg, LEVEL_1, "\tinsn: %+F\n", irn));
be_foreach_definition(irn, env->cls, def, req,
......@@ -101,23 +98,27 @@ void create_borders(ir_node *block, void *env_ptr)
border_def(def, step, 1);
);
/* Examine the uses. */
be_foreach_use(irn, env->cls, in_req_, op, op_req_,
const char *msg = "-";
/* If the node is no phi node we can examine the uses. */
if (!is_Phi(irn)) {
be_foreach_use(irn, env->cls, in_req_, op, op_req_,
const char *msg = "-";
if (ir_nodeset_insert(&live, op)) {
border_use(op, step, 1);
msg = "X";
}
if (ir_nodeset_insert(&live, op)) {
border_use(op, step, 1);
msg = "X";
}
DB((dbg, LEVEL_4, "\t\t%s pos: %d, use: %+F\n", msg, i_, op));
);
DB((dbg, LEVEL_4, "\t\t%s pos: %d, use: %+F\n", msg, i_, op));
);
}
++step;
}
/* Process live-ins last. In particular all Phis are handled before, so when
* iterating the borders the live-ins come before all Phis ("live-start"). */
foreach_ir_nodeset(&live, irn, iter) {
assert(be_is_live_in(lv, block, irn) ^ (is_Phi(irn) && get_nodes_block(irn) == block));
border_def(irn, step, get_nodes_block(irn) == block);
assert(be_is_live_in(lv, block, irn));
border_def(irn, step, 0);
}
ir_nodeset_destroy(&live);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment