Commit 0caf8d86 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

becopyilp: Use a ir_nodeset instead of a pset for all_removed.

parent 90e7800f
......@@ -86,7 +86,7 @@ static size_red_t *new_size_red(copy_opt_t *co)
size_red_t *res = XMALLOC(size_red_t);
res->co = co;
res->all_removed = pset_new_ptr_default();
ir_nodeset_init(&res->all_removed);
res->col_suff = NULL;
obstack_init(&res->ob);
......@@ -150,7 +150,7 @@ static void sr_remove(size_red_t *const sr)
cs->next = sr->col_suff;
sr->col_suff = cs;
pset_insert_ptr(sr->all_removed, irn);
ir_nodeset_insert(&sr->all_removed, irn);
redo = true;
}
......@@ -211,7 +211,7 @@ static void sr_reinsert(size_red_t *const sr)
assert(free_col < n_regs);
}
set_irn_col(sr->co->cls, irn, free_col);
pset_remove_ptr(sr->all_removed, irn); /* irn is back in graph again */
ir_nodeset_remove(&sr->all_removed, irn); /* irn is back in graph again */
}
}
......@@ -220,8 +220,8 @@ static void sr_reinsert(size_red_t *const sr)
*/
static void free_size_red(size_red_t *const sr)
{
del_pset(sr->all_removed);
obstack_free(&sr->ob, NULL);
ir_nodeset_destroy(&sr->all_removed);
free(sr);
}
......
......@@ -13,7 +13,6 @@
#define FIRM_BE_BECOPYILP_T_H
#include "firm_types.h"
#include "pset.h"
#include "becopyopt_t.h"
/******************************************************************************
......@@ -35,7 +34,7 @@ struct coloring_suffix_t {
typedef struct size_red_t {
copy_opt_t *co;
pset *all_removed; /**< All nodes removed during problem size reduction */
ir_nodeset_t all_removed; /**< All nodes removed during problem size reduction */
coloring_suffix_t *col_suff; /**< Coloring suffix. Reverse would be a PEO prefix */
struct obstack ob;
} size_red_t;
......@@ -43,7 +42,10 @@ typedef struct size_red_t {
/**
* Checks if a node has already been removed
*/
#define sr_is_removed(sr, irn) pset_find_ptr((sr)->all_removed, irn)
static inline bool sr_is_removed(size_red_t const *const sr, ir_node const *const irn)
{
return ir_nodeset_contains(&sr->all_removed, irn);
}
/**
* TODO: This search is necessary because during the construction of the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment