differntiate entity kinds
[libfirm] / ir / be / becopyopt.c
index 23064ac..04516a4 100644 (file)
@@ -22,7 +22,6 @@
  * @brief       Copy minimization driver.
  * @author      Daniel Grund
  * @date        12.04.2005
- * @version     $Id$
  *
  * Main file for the optimization reducing the copies needed for:
  * - Phi coalescing
@@ -42,9 +41,9 @@
 #include "irprog.h"
 #include "irloop_t.h"
 #include "iredges_t.h"
-#include "irbitset.h"
 #include "irprintf_t.h"
 #include "irtools.h"
+#include "util.h"
 
 #include "bemodule.h"
 #include "bearch.h"
@@ -703,7 +702,7 @@ int co_get_lower_bound(const copy_opt_t *co)
 
 void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
 {
-       bitset_t *seen = bitset_irg_malloc(co->irg);
+       bitset_t *seen = bitset_malloc(get_irg_last_idx(co->irg));
        affinity_node_t *an;
 
        memset(stat, 0, sizeof(stat[0]));
@@ -712,9 +711,9 @@ void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
        co_gs_foreach_aff_node(co, an) {
                neighb_t *neigh;
                stat->aff_nodes += 1;
-               bitset_add_irn(seen, an->irn);
+               bitset_set(seen, get_irn_idx(an->irn));
                co_gs_foreach_neighb(an, neigh) {
-                       if (!bitset_contains_irn(seen, neigh->irn)) {
+                       if (!bitset_is_set(seen, get_irn_idx(neigh->irn))) {
                                stat->aff_edges += 1;
                                stat->max_costs += neigh->costs;
 
@@ -1210,16 +1209,16 @@ void co_driver(be_chordal_env_t *cenv)
        co_complete_stats(co, &after);
 
        if (do_stats) {
-               ulong64 optimizable_costs = after.max_costs - after.inevit_costs;
-               ulong64 evitable          = after.costs     - after.inevit_costs;
+               unsigned long long optimizable_costs = after.max_costs - after.inevit_costs;
+               unsigned long long evitable          = after.costs     - after.inevit_costs;
 
                ir_printf("%30F ", cenv->irg);
-               printf("%10s %10" ULL_FMT "%10" ULL_FMT "%10" ULL_FMT, cenv->cls->name, after.max_costs, before.costs, after.inevit_costs);
+               printf("%10s %10llu%10llu%10llu", cenv->cls->name, after.max_costs, before.costs, after.inevit_costs);
 
                if (optimizable_costs > 0)
-                       printf("%10" ULL_FMT " %5.2f\n", after.costs, (evitable * 100.0) / optimizable_costs);
+                       printf("%10llu %5.2f\n", after.costs, (evitable * 100.0) / optimizable_costs);
                else
-                       printf("%10" ULL_FMT " %5s\n", after.costs, "-");
+                       printf("%10llu %5s\n", after.costs, "-");
        }
 
        /* Dump the interference graph in Appel's format. */