adapted to new reqister_should_be_equal requirement
authorDaniel Grund <grund@cs.uni-saarland.de>
Tue, 17 Jan 2006 09:27:41 +0000 (09:27 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Tue, 17 Jan 2006 09:27:41 +0000 (09:27 +0000)
ir/be/bearch.h
ir/be/becopyopt.c

index f0b922d..caf9294 100644 (file)
@@ -160,7 +160,7 @@ typedef struct _arch_register_req_t {
                                             return the number of registers
                                             in the bitset. */
 
-       const ir_node *other;                /**< In case of "should be equal"
+       ir_node *other;                                           /**< In case of "should be equal"
                                                                                    or should be different, this gives
                                                                                        the node to whose register this
                                                                                        one's should be the same/different. */
index 3188344..d45ba4c 100644 (file)
@@ -197,15 +197,14 @@ static void co_collect_units(ir_node *irn, void *env) {
 
        /* Src == Tgt of a 2-addr-code instruction */
        if (is_2addr_code(get_arch_env(co), irn, &req)) {
-               int pos = req.pos;
-               ir_node *other = get_irn_n(irn, pos);
+               ir_node *other = req.other;
                if (!nodes_interfere(co->chordal_env, irn, other)) {
                        unit->nodes = xmalloc(2 * sizeof(*unit->nodes));
                        unit->costs = xmalloc(2 * sizeof(*unit->costs));
                        unit->node_count = 2;
                        unit->nodes[0] = irn;
                        unit->nodes[1] = other;
-                       unit->costs[1] = co->get_costs(irn, other, pos);
+                       unit->costs[1] = co->get_costs(irn, other, -120480);
                }
        } else
                assert(0 && "This is not an optimizable node!");
@@ -278,7 +277,7 @@ int is_optimizable_arg(const copy_opt_t *co, ir_node *irn) {
 
                arch_get_register_req(aenv, &req, n, -1);
 
-               if(     (       (req.type == arch_register_req_type_should_be_same && get_irn_n(n, req.pos) == irn) ||
+               if(     (       (req.type == arch_register_req_type_should_be_same && req.other == irn) ||
                                is_Reg_Phi(n) ||
                                is_Perm(get_arch_env(co), n)
                        ) && (irn == n || !nodes_interfere(co->chordal_env, irn, n)))