fixed output of arm_emit_shift()
[libfirm] / ir / be / bechordal.c
index dca28ef..b77323e 100644 (file)
@@ -501,7 +501,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i
        int *assignment;
        pmap *partners;
        int i, n_alloc;
-       long col;
+       bitset_pos_t col;
        const ir_edge_t *edge;
        ir_node *perm = NULL;
        int match_res, cost;
@@ -740,11 +740,10 @@ static void pressure(ir_node *block, void *env_ptr)
        be_lv_t *lv                       = env->birg->lv;
 
        int i, n;
+       bitset_pos_t elm;
        unsigned step = 0;
        unsigned pressure = 0;
        struct list_head *head;
-       pset *live_in  = be_lv_pset_put_in(lv, block, pset_new_ptr_default());
-       pset *live_end = be_lv_pset_put_end(lv, block, pset_new_ptr_default());
 
        DBG((dbg, LEVEL_1, "Computing pressure in block %+F\n", block));
        bitset_clear_all(live);
@@ -759,7 +758,8 @@ static void pressure(ir_node *block, void *env_ptr)
         * Make final uses of all values live out of the block.
         * They are necessary to build up real intervals.
         */
-       foreach_pset(live_end, irn) {
+       be_lv_foreach(lv, block, be_lv_state_end, i) {
+               ir_node *irn = be_lv_get_irn(lv, block, i);
                if(has_reg_class(env, irn)) {
                        DBG((dbg, LEVEL_3, "\tMaking live: %+F/%d\n", irn, get_irn_idx(irn)));
                        bitset_set(live, get_irn_idx(irn));
@@ -776,6 +776,26 @@ static void pressure(ir_node *block, void *env_ptr)
                DBG((dbg, LEVEL_1, "\tinsn: %+F, pressure: %d\n", irn, pressure));
                DBG((dbg, LEVEL_2, "\tlive: %B\n", live));
 
+#ifndef SCHEDULE_PROJS
+               if (get_irn_mode(irn) == mode_T) {
+                       const ir_edge_t *edge;
+
+                       foreach_out_edge(irn, edge) {
+                               ir_node *proj = get_edge_src_irn(edge);
+
+                               /*
+                                * If the node defines some value, which can put into a
+                                * register of the current class, make a border for it.
+                                */
+                               if(has_reg_class(env, proj)) {
+                                       int nr = get_irn_idx(proj);
+
+                                       bitset_clear(live, nr);
+                                       border_def(proj, step, 1);
+                               }
+                       }
+               }
+#endif
                /*
                 * If the node defines some value, which can put into a
                 * register of the current class, make a border for it.
@@ -811,22 +831,11 @@ static void pressure(ir_node *block, void *env_ptr)
                ++step;
        }
 
-       /*
-        * Add initial defs for all values live in.
-        */
-       foreach_pset(live_in, irn) {
-               if(has_reg_class(env, irn)) {
-
-                       /* Mark the value live in. */
-                       bitset_set(live, get_irn_idx(irn));
-
-                       /* Add the def */
+       bitset_foreach(live, elm) {
+               ir_node *irn = get_idx_irn(env->irg, elm);
+               if (be_is_live_in(lv, block, irn))
                        border_def(irn, step, 0);
-               }
        }
-
-       del_pset(live_in);
-       del_pset(live_end);
 }
 
 static void assign(ir_node *block, void *env_ptr)