From 7081067d3b4017a9171d997ee677e03804209965 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 24 Nov 2012 14:15:39 +0100 Subject: [PATCH] beinsn: Remove the attribute next_insn from struct be_insn_t. Just use sched_next(). --- ir/be/bechordal.c | 8 ++++---- ir/be/beinsn.c | 3 +-- ir/be/beinsn_t.h | 1 - ir/be/bepbqpcoloring.c | 11 +++++------ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/ir/be/bechordal.c b/ir/be/bechordal.c index b8a598238..08fb2f047 100644 --- a/ir/be/bechordal.c +++ b/ir/be/bechordal.c @@ -165,7 +165,7 @@ static void pair_up_operands(const be_chordal_alloc_env_t *alloc_env, be_insn_t } } -static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, +static void handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *irn) { int n_regs; @@ -180,7 +180,6 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, be_chordal_env_t *env = alloc_env->chordal_env; void *base = obstack_base(env->obst); be_insn_t *insn = be_scan_insn(env, irn); - ir_node *res = insn->next_insn; bipartite_t *bp; if (insn->pre_colored) { @@ -374,7 +373,6 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, end: obstack_free(env->obst, base); - return res; } /** @@ -390,7 +388,9 @@ static void constraints(ir_node *bl, void *data) ir_node *irn; for (irn = sched_first(bl); !sched_is_end(irn);) { - irn = handle_constraints(env, irn); + ir_node *const next = sched_next(irn); + handle_constraints(env, irn); + irn = next; } } diff --git a/ir/be/beinsn.c b/ir/be/beinsn.c index 1c84ab20f..849619edb 100644 --- a/ir/be/beinsn.c +++ b/ir/be/beinsn.c @@ -45,8 +45,7 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn) be_insn_t *insn = OALLOCZ(obst, be_insn_t); - insn->irn = irn; - insn->next_insn = sched_next(irn); + insn->irn = irn; if (get_irn_mode(irn) == mode_T) { ir_node *p; diff --git a/ir/be/beinsn_t.h b/ir/be/beinsn_t.h index 033ef60e6..5e7db184f 100644 --- a/ir/be/beinsn_t.h +++ b/ir/be/beinsn_t.h @@ -51,7 +51,6 @@ struct be_insn_t { int n_ops; /**< length of the ops array */ int use_start; /**< entries [0-use_start) in ops are defs, [use_start-n_ops) uses */ - ir_node *next_insn; /**< next instruction in schedule */ ir_node *irn; /**< ir_node of the instruction */ unsigned has_constraints : 1; /**< in_constraints or out_constraints true */ unsigned pre_colored : 1; /**< all defined values already have a register assigned */ diff --git a/ir/be/bepbqpcoloring.c b/ir/be/bepbqpcoloring.c index c0f5a782e..b5ddcaecc 100644 --- a/ir/be/bepbqpcoloring.c +++ b/ir/be/bepbqpcoloring.c @@ -595,13 +595,12 @@ static void insert_perms(ir_node *block, void *data) ir_node *irn; for (irn = sched_first(block); !sched_is_end(irn);) { - be_insn_t *insn = be_scan_insn(env, irn); - irn = insn->next_insn; + ir_node *const next = sched_next(irn); + be_insn_t * insn = be_scan_insn(env, irn); + if (insn->has_constraints) + pre_process_constraints(env, &insn); - if (!insn->has_constraints) - continue; - - pre_process_constraints(env, &insn); + irn = next; } } -- 2.20.1