summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bechordal_common.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-12-15 09:23:07 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-12-15 22:03:45 +0100
commitb0b017615d99df915f731aa23842e26a10691f05 (patch)
tree1526399b3ca75b3bdbb60c35bcfcc3408a7ea37b /ir/be/bechordal_common.c
parent552fbc58ec9d3f1623cee651661061c59f367b05 (diff)
bechordal: Handle Phis more like live-ins instead of regular scheduled nodes in create_borders().
Diffstat (limited to 'ir/be/bechordal_common.c')
-rw-r--r--ir/be/bechordal_common.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/ir/be/bechordal_common.c b/ir/be/bechordal_common.c
index a179117..692154c 100644
--- a/ir/be/bechordal_common.c
+++ b/ir/be/bechordal_common.c
@@ -127,6 +127,9 @@ 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, pressure: %d\n", irn, pressure));
be_foreach_definition(irn, env->cls, def, req,
@@ -138,27 +141,23 @@ void create_borders(ir_node *block, void *env_ptr)
border_def(def, step, 1);
);
- /*
- * 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";
- }
-
- DB((dbg, LEVEL_4, "\t\t%s pos: %d, use: %+F\n", msg, i_, op));
- );
- }
+ /* Examine the uses. */
+ 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";
+ }
+
+ DB((dbg, LEVEL_4, "\t\t%s pos: %d, use: %+F\n", msg, i_, op));
+ );
++step;
}
foreach_ir_nodeset(&live, irn, iter) {
- assert(be_is_live_in(lv, block, irn));
- border_def(irn, step, 0);
+ 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);
}
ir_nodeset_destroy(&live);