addendum to the should_be_same fix: we also have to use the same rule for the dynamic...
authorMatthias Braun <matze@braunis.de>
Tue, 25 Aug 2009 11:03:22 +0000 (11:03 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 25 Aug 2009 11:03:22 +0000 (11:03 +0000)
[r26422]

ir/be/benewalloc.c

index 19ed9a6..dd2ebd2 100644 (file)
@@ -321,9 +321,8 @@ static void check_defs(const ir_nodeset_t *live_nodes, float weight,
                        /* if we the value at the should_be_same input doesn't die at the
                         * node, then it is no use to propagate the constraints (since a
                         * copy will emerge anyway) */
-                       if (ir_nodeset_contains(live_nodes, op)) {
+                       if (ir_nodeset_contains(live_nodes, op))
                                continue;
-                       }
 
                        op_info = get_allocation_info(op);
                        for (r = 0; r < n_regs; ++r) {
@@ -559,6 +558,12 @@ static void assign_reg(const ir_node *block, ir_node *node,
                        reg = arch_get_irn_register(in);
                        assert(reg != NULL);
                        r = arch_register_get_index(reg);
+
+                       /* if the value didn't die here then we should not propagate the
+                        * should_be_same info */
+                       if (assignments[r].value == in)
+                               continue;
+
                        info->prefs[r] += weight * AFF_SHOULD_BE_SAME;
                }
        }