beinsn: Remove the attribute next_insn from struct be_insn_t.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 13:15:39 +0000 (14:15 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 24 Nov 2012 13:15:39 +0000 (14:15 +0100)
Just use sched_next().

ir/be/bechordal.c
ir/be/beinsn.c
ir/be/beinsn_t.h
ir/be/bepbqpcoloring.c

index b8a5982..08fb2f0 100644 (file)
@@ -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;
        }
 }
 
index 1c84ab2..849619e 100644 (file)
@@ -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;
 
index 033ef60..5e7db18 100644 (file)
@@ -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 */
index c0f5a78..b5ddcae 100644 (file)
@@ -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;
        }
 }