summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bechordal_common.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-12-17 00:16:58 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-12-17 00:16:58 +0100
commit45cfa914f549aa6b46d907844206593b7f23b30c (patch)
tree7bdb318556e9b38cd367a3f7c795517e1aa6664e /ir/be/bechordal_common.c
parent0ac0b440ce2d239c5e7e7db56b8273559d9a7741 (diff)
bechordal: Process Phis before live-in nodes again.
Add a comment, why this is an important property.
Diffstat (limited to 'ir/be/bechordal_common.c')
-rw-r--r--ir/be/bechordal_common.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ir/be/bechordal_common.c b/ir/be/bechordal_common.c
index 5afbaa4..5a9c0c7 100644
--- a/ir/be/bechordal_common.c
+++ b/ir/be/bechordal_common.c
@@ -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);