summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bespilldaemel.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-07 03:04:54 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-07 14:33:19 +0200
commit2f0eeca3751e8628584a6a51c40c4a71b6051c37 (patch)
tree144955a169e33dbbe03e144200679ae859a5a48c /ir/be/bespilldaemel.c
parent605f090a89439312aefdc8e01b209a6596ae9390 (diff)
be: Add and use macros to iterate only/all nodes except Phis in the schedule.
Diffstat (limited to 'ir/be/bespilldaemel.c')
-rw-r--r--ir/be/bespilldaemel.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ir/be/bespilldaemel.c b/ir/be/bespilldaemel.c
index b3db80d..2cd9ab1 100644
--- a/ir/be/bespilldaemel.c
+++ b/ir/be/bespilldaemel.c
@@ -254,10 +254,7 @@ static void spill_block(ir_node *block, void *data)
/* walk schedule backwards and spill until register pressure is fine at
* each node */
- sched_foreach_reverse(block, node) {
- if (is_Phi(node))
- break;
-
+ sched_foreach_non_phi_reverse(block, node) {
remove_defs(node, &live_nodes);
do_spilling(&live_nodes, node);
add_uses(node, &live_nodes);
@@ -267,10 +264,7 @@ static void spill_block(ir_node *block, void *data)
* are still there and occupy registers, so we need to count them and might
* have to spill some of them. */
int n_phi_values_spilled = 0;
- sched_foreach(block, node) {
- if (!is_Phi(node))
- break;
-
+ sched_foreach_phi(block, node) {
if (bitset_is_set(spilled_nodes, get_irn_idx(node)))
n_phi_values_spilled += get_value_width(node);
}
@@ -289,9 +283,7 @@ static void spill_block(ir_node *block, void *data)
/* spill as many phis as needed */
/* TODO: we should really estimate costs of the phi spill as well...
* and preferably spill phis with lower costs... */
- sched_foreach(block, node) {
- if (!is_Phi(node))
- break;
+ sched_foreach_phi(block, node) {
if (phi_spills_needed <= 0)
break;