report nextuse place in beuses, add a function which reports normal reload costs...
[libfirm] / ir / be / belower.c
index 3be7fda..2ca04d5 100644 (file)
@@ -631,12 +631,14 @@ static void assure_different_constraints(ir_node *irn, constraint_env_t *env) {
        req = arch_get_register_req(arch_env, irn, -1);
 
        if (arch_register_req_is(req, should_be_different)) {
-               ir_node *different_from = get_irn_n(belower_skip_proj(irn), req->other_different);
-               gen_assure_different_pattern(irn, different_from, env);
-       } else if (arch_register_req_is(req, should_be_different_from_all)) {
-               int i, n = get_irn_arity(belower_skip_proj(irn));
-               for (i = 0; i < n; i++) {
-                       gen_assure_different_pattern(irn, get_irn_n(belower_skip_proj(irn), i), env);
+               const unsigned other = req->other_different;
+               int i;
+
+               for (i = 0; 1U << i <= other; ++i) {
+                       if (other & (1U << i)) {
+                               ir_node *different_from = get_irn_n(belower_skip_proj(irn), i);
+                               gen_assure_different_pattern(irn, different_from, env);
+                       }
                }
        }
 }
@@ -761,9 +763,10 @@ static void melt_copykeeps(constraint_env_t *cenv) {
                                ir_nodeset_insert(&entry->copies, new_ck);
 
                                /* find scheduling point */
+                               sched_pt = ref_mode_T;
                                do {
                                        /* just walk along the schedule until a non-Keep/CopyKeep node is found */
-                                       sched_pt = sched_next(ref_mode_T);
+                                       sched_pt = sched_next(sched_pt);
                                } while (be_is_Keep(sched_pt) || be_is_CopyKeep(sched_pt));
 
                                sched_add_before(sched_pt, new_ck);