becopyilp: fix size_reduction code
[libfirm] / ir / be / becopyopt.c
index f4e5f23..9f65aee 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,7 +41,6 @@
 #include "irprog.h"
 #include "irloop_t.h"
 #include "iredges_t.h"
-#include "irbitset.h"
 #include "irprintf_t.h"
 #include "irtools.h"
 #include "util.h"
@@ -88,6 +86,16 @@ static const lc_opt_enum_mask_items_t dump_items[] = {
        { NULL,      0 }
 };
 
+/**
+ * Flags for dumping the IFG.
+ */
+enum {
+       CO_IFG_DUMP_COLORS = 1 << 0, /**< Dump the graph colored. */
+       CO_IFG_DUMP_LABELS = 1 << 1, /**< Dump node/edge labels. */
+       CO_IFG_DUMP_SHAPE  = 1 << 2, /**< Give constrained nodes special shapes. */
+       CO_IFG_DUMP_CONSTR = 1 << 3, /**< Dump the node constraints in the label. */
+};
+
 static const lc_opt_enum_mask_items_t style_items[] = {
        { "color",   CO_IFG_DUMP_COLORS },
        { "labels",  CO_IFG_DUMP_LABELS },
@@ -704,7 +712,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]));
@@ -713,9 +721,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;
 
@@ -1104,12 +1112,6 @@ void co_dump_ifg_dot(const copy_opt_t *co, FILE *f, unsigned flags)
        be_ifg_dump_dot(co->cenv->ifg, co->irg, f, &ifg_dot_cb, &cod);
 }
 
-
-void co_solve_park_moon(copy_opt_t *opt)
-{
-       (void) opt;
-}
-
 /*
     __  __       _         ____       _
    |  \/  | __ _(_)_ __   |  _ \ _ __(_)_   _____ _ __