be: Use sched_add_before(a, b) instead of sched_add_after(sched_prev(a), b).
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 2 Dec 2012 08:36:47 +0000 (09:36 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 2 Dec 2012 08:59:06 +0000 (09:59 +0100)
ir/be/amd64/bearch_amd64.c
ir/be/arm/bearch_arm.c
ir/be/ia32/bearch_ia32.c

index c43e6e4..34b4d3e 100644 (file)
@@ -149,10 +149,8 @@ static void transform_Reload(ir_node *node)
        ir_node   *proj;
        ir_node   *load;
 
-       ir_node  *sched_point = sched_prev(node);
-
        load = new_bd_amd64_Load(dbgi, block, ptr, mem, entity);
-       sched_add_after(sched_point, load);
+       sched_add_before(node, load);
        sched_remove(node);
 
        proj = new_rd_Proj(dbgi, load, mode, pn_amd64_Load_res);
@@ -173,14 +171,11 @@ static void transform_Spill(ir_node *node)
        ir_node   *val    = get_irn_n(node, n_be_Spill_val);
        //ir_mode   *mode   = get_irn_mode(val);
        ir_entity *entity = be_get_frame_entity(node);
-       ir_node   *sched_point;
        ir_node   *store;
 
-       sched_point = sched_prev(node);
        store = new_bd_amd64_Store(dbgi, block, ptr, val, mem, entity);
-
+       sched_add_before(node, store);
        sched_remove(node);
-       sched_add_after(sched_point, store);
 
        exchange(node, store);
 }
index 03a6d20..13519fd 100644 (file)
@@ -191,10 +191,8 @@ static void transform_Reload(ir_node *node)
        ir_node   *proj;
        ir_node   *load;
 
-       ir_node  *sched_point = sched_prev(node);
-
        load = new_bd_arm_Ldr(dbgi, block, ptr, mem, mode, entity, false, 0, true);
-       sched_add_after(sched_point, load);
+       sched_add_before(node, load);
        sched_remove(node);
 
        proj = new_rd_Proj(dbgi, load, mode, pn_arm_Ldr_res);
@@ -215,15 +213,12 @@ static void transform_Spill(ir_node *node)
        ir_node   *val    = get_irn_n(node, n_be_Spill_val);
        ir_mode   *mode   = get_irn_mode(val);
        ir_entity *entity = be_get_frame_entity(node);
-       ir_node   *sched_point;
        ir_node   *store;
 
-       sched_point = sched_prev(node);
        store = new_bd_arm_Str(dbgi, block, ptr, val, mem, mode, entity, false, 0,
                               true);
-
+       sched_add_before(node, store);
        sched_remove(node);
-       sched_add_after(sched_point, store);
 
        exchange(node, store);
 }
index 9030397..dc23dbf 100644 (file)
@@ -675,8 +675,6 @@ static void transform_to_Load(ir_node *node)
        ir_node *new_op, *proj;
        const arch_register_t *reg;
 
-       ir_node *const sched_point = sched_prev(node);
-
        if (mode_is_float(spillmode)) {
                if (ia32_cg_config.use_sse2)
                        new_op = new_bd_ia32_xLoad(dbgi, block, ptr, noreg, mem, spillmode);
@@ -700,7 +698,7 @@ static void transform_to_Load(ir_node *node)
 
        proj = new_rd_Proj(dbgi, new_op, mode, pn_ia32_Load_res);
 
-       sched_add_after(sched_point, new_op);
+       sched_add_before(node, new_op);
        sched_remove(node);
 
        /* copy the register from the old node to the new Load */
@@ -730,8 +728,6 @@ static void transform_to_Store(ir_node *node)
        ir_node *res;
        ir_node *store;
 
-       ir_node *const sched_point = sched_prev(node);
-
        if (mode_is_float(mode)) {
                if (ia32_cg_config.use_sse2) {
                        store = new_bd_ia32_xStore(dbgi, block, ptr, noreg, nomem, val);
@@ -760,7 +756,7 @@ static void transform_to_Store(ir_node *node)
        SET_IA32_ORIG_NODE(store, node);
        DBG_OPT_SPILL2ST(node, store);
 
-       sched_add_after(sched_point, store);
+       sched_add_before(node, store);
        sched_remove(node);
 
        exchange(node, res);