summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bepeephole.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2014-02-13 16:38:46 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2014-02-17 14:11:15 +0100
commit0ea8b7276a18cf5cdaa89cf6b054faa60086f9a0 (patch)
tree01d0462aed83d8b63097e7091b1feafde5f683b1 /ir/be/bepeephole.c
parentcc281f880e6e186609e3c0222dca4dfca968f1f6 (diff)
Add and use foreach_irn_pred{,_r}().
Diffstat (limited to 'ir/be/bepeephole.c')
-rw-r--r--ir/be/bepeephole.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/ir/be/bepeephole.c b/ir/be/bepeephole.c
index dc51f01..35f669e 100644
--- a/ir/be/bepeephole.c
+++ b/ir/be/bepeephole.c
@@ -83,12 +83,8 @@ static void clear_defs(ir_node *node)
static void set_uses(ir_node *node)
{
- int i, arity;
-
/* set values used */
- arity = get_irn_arity(node);
- for (i = 0; i < arity; ++i) {
- ir_node *in = get_irn_n(node, i);
+ foreach_irn_in(node, i, in) {
set_reg_value(in);
}
}
@@ -233,7 +229,6 @@ bool be_can_move_down(ir_heights_t *heights, const ir_node *node,
assert(get_nodes_block(node) == get_nodes_block(before));
assert(sched_get_time_step(node) < sched_get_time_step(before));
- int node_arity = get_irn_arity(node);
ir_node *schedpoint = sched_next(node);
while (schedpoint != before) {
@@ -242,9 +237,8 @@ bool be_can_move_down(ir_heights_t *heights, const ir_node *node,
return false;
/* schedpoint must not overwrite registers of our inputs */
- for (int i = 0; i < node_arity; ++i) {
- ir_node *in = get_irn_n(node, i);
- const arch_register_t *reg = arch_get_irn_register(in);
+ foreach_irn_in(node, i, in) {
+ const arch_register_t *reg = arch_get_irn_register(in);
if (reg == NULL)
continue;
const arch_register_req_t *in_req