Commit 64f29db9 authored by Matthias Braun's avatar Matthias Braun
Browse files

becopopt: cleanup

parent f7fe0b3b
...@@ -47,14 +47,27 @@ ...@@ -47,14 +47,27 @@
#include "lc_opts.h" #include "lc_opts.h"
#include "lc_opts_enum.h" #include "lc_opts_enum.h"
#define MIS_HEUR_TRIGGER 8
#define DUMP_BEFORE 1 #define DUMP_BEFORE 1
#define DUMP_AFTER 2 #define DUMP_AFTER 2
#define DUMP_APPEL 4 #define DUMP_APPEL 4
#define DUMP_ALL 2 * DUMP_APPEL - 1 #define DUMP_ALL 2 * DUMP_APPEL - 1
#define COST_FUNC_FREQ 1 #define list_entry_units(lh) list_entry(lh, unit_t, units)
#define COST_FUNC_LOOP 2
#define COST_FUNC_ALL_ONE 3 /**
* Statistics over a copy optimization module.
*/
typedef struct {
unsigned long long aff_edges; /**< number of affinity edges. */
unsigned long long aff_nodes; /**< number of nodes with incident affinity edges. */
unsigned long long aff_int; /**< number of affinity edges whose nodes also interfere. */
unsigned long long inevit_costs; /**< costs which cannot be evited (due to interfering affinities). */
unsigned long long max_costs; /**< all costs of the affinities. */
unsigned long long costs; /**< The costs of the current coloring. */
unsigned long long unsatisfied_edges; /**< The number of unequally colored affinity edges. */
} co_complete_stats_t;
/** /**
* Flags for dumping the IFG. * Flags for dumping the IFG.
...@@ -66,6 +79,8 @@ enum { ...@@ -66,6 +79,8 @@ enum {
CO_IFG_DUMP_CONSTR = 1 << 3, /**< Dump the node constraints in the label. */ CO_IFG_DUMP_CONSTR = 1 << 3, /**< Dump the node constraints in the label. */
}; };
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
static int co_get_costs_loop_depth(const ir_node *root, int pos); static int co_get_costs_loop_depth(const ir_node *root, int pos);
static int co_get_costs_exec_freq(const ir_node *root, int pos); static int co_get_costs_exec_freq(const ir_node *root, int pos);
static int co_get_costs_all_one(const ir_node *root, int pos); static int co_get_costs_all_one(const ir_node *root, int pos);
...@@ -161,10 +176,7 @@ void be_init_copynone(void) ...@@ -161,10 +176,7 @@ void be_init_copynone(void)
be_register_copyopt("none", &copyheur); be_register_copyopt("none", &copyheur);
} }
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;) static copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env, cost_fct_t get_costs)
copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env, cost_fct_t get_costs)
{ {
FIRM_DBG_REGISTER(dbg, "ir.be.copyopt"); FIRM_DBG_REGISTER(dbg, "ir.be.copyopt");
...@@ -176,7 +188,7 @@ copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env, cost_fct_t get_costs) ...@@ -176,7 +188,7 @@ copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env, cost_fct_t get_costs)
return co; return co;
} }
void free_copy_opt(copy_opt_t *co) static void free_copy_opt(copy_opt_t *co)
{ {
free(co); free(co);
} }
...@@ -185,7 +197,7 @@ void free_copy_opt(copy_opt_t *co) ...@@ -185,7 +197,7 @@ void free_copy_opt(copy_opt_t *co)
* Checks if a node is optimizable, viz. has something to do with coalescing * Checks if a node is optimizable, viz. has something to do with coalescing
* @param irn The irn to check * @param irn The irn to check
*/ */
static bool co_is_optimizable_root(ir_node *irn) static bool co_is_optimizable_root(const ir_node *irn)
{ {
arch_register_req_t const *const req = arch_get_irn_register_req(irn); arch_register_req_t const *const req = arch_get_irn_register_req(irn);
if (arch_register_req_is(req, ignore)) if (arch_register_req_is(req, ignore))
...@@ -208,18 +220,18 @@ static bool co_is_optimizable_root(ir_node *irn) ...@@ -208,18 +220,18 @@ static bool co_is_optimizable_root(ir_node *irn)
static int co_get_costs_loop_depth(const ir_node *root, int pos) static int co_get_costs_loop_depth(const ir_node *root, int pos)
{ {
ir_node *block = get_nodes_block(root); ir_node *block = get_nodes_block(root);
if (is_Phi(root)) { if (is_Phi(root))
block = get_Block_cfgpred_block(block, pos); block = get_Block_cfgpred_block(block, pos);
}
ir_loop *loop = get_irn_loop(block); ir_loop *loop = get_irn_loop(block);
int cost; int cost;
if (loop) { if (loop != NULL) {
int d = get_loop_depth(loop); int d = get_loop_depth(loop);
cost = d*d; cost = d*d;
} else { } else {
cost = 0; cost = 0;
} }
return 1+cost; return cost+1;
} }
static ir_execfreq_int_factors factors; static ir_execfreq_int_factors factors;
...@@ -254,17 +266,6 @@ static int co_get_costs_all_one(const ir_node *root, int pos) ...@@ -254,17 +266,6 @@ static int co_get_costs_all_one(const ir_node *root, int pos)
return 1; return 1;
} }
/******************************************************************************
____ _ _ _ _ _ _____ _
/ __ \ | | | | | | (_) | / ____| |
| | | |_ __ | |_| | | |_ __ _| |_ ___ | (___ | |_ ___ _ __ __ _ __ _ ___
| | | | '_ \| __| | | | '_ \| | __/ __| \___ \| __/ _ \| '__/ _` |/ _` |/ _ \
| |__| | |_) | |_| |__| | | | | | |_\__ \ ____) | || (_) | | | (_| | (_| | __/
\____/| .__/ \__|\____/|_| |_|_|\__|___/ |_____/ \__\___/|_| \__,_|\__, |\___|
| | __/ |
|_| |___/
******************************************************************************/
/** /**
* Determines a maximum weighted independent set with respect to * Determines a maximum weighted independent set with respect to
* the interference and conflict edges of all nodes in a qnode. * the interference and conflict edges of all nodes in a qnode.
...@@ -480,14 +481,14 @@ static void co_collect_units(ir_node *irn, void *env) ...@@ -480,14 +481,14 @@ static void co_collect_units(ir_node *irn, void *env)
} }
} }
void co_build_ou_structure(copy_opt_t *co) static void co_build_ou_structure(copy_opt_t *co)
{ {
DBG((dbg, LEVEL_1, "\tCollecting optimization units\n")); DBG((dbg, LEVEL_1, "\tCollecting optimization units\n"));
INIT_LIST_HEAD(&co->units); INIT_LIST_HEAD(&co->units);
irg_walk_graph(co->irg, co_collect_units, NULL, co); irg_walk_graph(co->irg, co_collect_units, NULL, co);
} }
void co_free_ou_structure(copy_opt_t *co) static void co_free_ou_structure(copy_opt_t *co)
{ {
ASSERT_OU_AVAIL(co); ASSERT_OU_AVAIL(co);
list_for_each_entry_safe(unit_t, curr, tmp, &co->units, units) { list_for_each_entry_safe(unit_t, curr, tmp, &co->units, units) {
...@@ -498,21 +499,6 @@ void co_free_ou_structure(copy_opt_t *co) ...@@ -498,21 +499,6 @@ void co_free_ou_structure(copy_opt_t *co)
co->units.next = NULL; co->units.next = NULL;
} }
/* co_solve_heuristic() is implemented in becopyheur.c */
int co_get_max_copy_costs(const copy_opt_t *co)
{
ASSERT_OU_AVAIL(co);
int res = 0;
list_for_each_entry(unit_t, curr, &co->units, units) {
res += curr->inevitable_costs;
for (int i=1; i<curr->node_count; ++i)
res += curr->costs[i];
}
return res;
}
int co_get_inevit_copy_costs(const copy_opt_t *co) int co_get_inevit_copy_costs(const copy_opt_t *co)
{ {
ASSERT_OU_AVAIL(co); ASSERT_OU_AVAIL(co);
...@@ -523,26 +509,6 @@ int co_get_inevit_copy_costs(const copy_opt_t *co) ...@@ -523,26 +509,6 @@ int co_get_inevit_copy_costs(const copy_opt_t *co)
return res; return res;
} }
int co_get_copy_costs(const copy_opt_t *co)
{
ASSERT_OU_AVAIL(co);
int res = 0;
list_for_each_entry(unit_t, curr, &co->units, units) {
int root_col = get_irn_col(curr->nodes[0]);
DBG((dbg, LEVEL_1, " %3d costs for root %+F color %d\n", curr->inevitable_costs, curr->nodes[0], root_col));
res += curr->inevitable_costs;
for (int i=1; i<curr->node_count; ++i) {
int arg_col = get_irn_col(curr->nodes[i]);
if (root_col != arg_col) {
DBG((dbg, LEVEL_1, " %3d for arg %+F color %d\n", curr->costs[i], curr->nodes[i], arg_col));
res += curr->costs[i];
}
}
}
return res;
}
int co_get_lower_bound(const copy_opt_t *co) int co_get_lower_bound(const copy_opt_t *co)
{ {
ASSERT_OU_AVAIL(co); ASSERT_OU_AVAIL(co);
...@@ -553,7 +519,7 @@ int co_get_lower_bound(const copy_opt_t *co) ...@@ -553,7 +519,7 @@ int co_get_lower_bound(const copy_opt_t *co)
return res; return res;
} }
void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat) static void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
{ {
bitset_t *seen = bitset_malloc(get_irg_last_idx(co->irg)); bitset_t *seen = bitset_malloc(get_irg_last_idx(co->irg));
...@@ -577,7 +543,6 @@ void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat) ...@@ -577,7 +543,6 @@ void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
stat->aff_int += 1; stat->aff_int += 1;
stat->inevit_costs += neigh->costs; stat->inevit_costs += neigh->costs;
} }
} }
} }
} }
...@@ -660,7 +625,10 @@ static void build_graph_walker(ir_node *irn, void *env) ...@@ -660,7 +625,10 @@ static void build_graph_walker(ir_node *irn, void *env)
} }
} }
void co_build_graph_structure(copy_opt_t *co) /**
* Constructs another internal representation of the affinity edges
*/
static void co_build_graph_structure(copy_opt_t *co)
{ {
obstack_init(&co->obst); obstack_init(&co->obst);
co->nodes = new_set(compare_affinity_node_t, 32); co->nodes = new_set(compare_affinity_node_t, 32);
...@@ -668,7 +636,11 @@ void co_build_graph_structure(copy_opt_t *co) ...@@ -668,7 +636,11 @@ void co_build_graph_structure(copy_opt_t *co)
irg_walk_graph(co->irg, build_graph_walker, NULL, co); irg_walk_graph(co->irg, build_graph_walker, NULL, co);
} }
void co_free_graph_structure(copy_opt_t *co) /**
* Frees the space used by the graph representation.
* Does NOT free the whole copyopt structure
*/
static void co_free_graph_structure(copy_opt_t *co)
{ {
ASSERT_GS_AVAIL(co); ASSERT_GS_AVAIL(co);
...@@ -677,7 +649,7 @@ void co_free_graph_structure(copy_opt_t *co) ...@@ -677,7 +649,7 @@ void co_free_graph_structure(copy_opt_t *co)
co->nodes = NULL; co->nodes = NULL;
} }
int co_gs_is_optimizable(copy_opt_t const *const co, ir_node *const irn) bool co_gs_is_optimizable(copy_opt_t const *const co, ir_node *const irn)
{ {
ASSERT_GS_AVAIL(co); ASSERT_GS_AVAIL(co);
...@@ -757,8 +729,8 @@ static void co_dump_appel_graph(const copy_opt_t *co, FILE *f) ...@@ -757,8 +729,8 @@ static void co_dump_appel_graph(const copy_opt_t *co, FILE *f)
neighbours_iter_t nit; neighbours_iter_t nit;
be_ifg_foreach_neighbour(ifg, &nit, irn, adj) { be_ifg_foreach_neighbour(ifg, &nit, irn, adj) {
if (!arch_irn_is_ignore(adj) && if (!arch_irn_is_ignore(adj)
!co_dump_appel_disjoint_constraints(irn, adj)) { && !co_dump_appel_disjoint_constraints(irn, adj)) {
int adj_idx = node_map[get_irn_idx(adj)]; int adj_idx = node_map[get_irn_idx(adj)];
if (idx < adj_idx) if (idx < adj_idx)
fprintf(f, "%d %d -1\n", idx, adj_idx); fprintf(f, "%d %d -1\n", idx, adj_idx);
...@@ -793,7 +765,8 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix, ...@@ -793,7 +765,8 @@ static FILE *my_open(const be_chordal_env_t *env, const char *prefix,
char buf[1024]; char buf[1024];
ir_snprintf(buf, sizeof(buf), "%s%s_%F_%s%s", prefix, tu_name, env->irg, env->cls->name, suffix); ir_snprintf(buf, sizeof(buf), "%s%s_%F_%s%s", prefix, tu_name, env->irg,
env->cls->name, suffix);
free(tu_name); free(tu_name);
FILE *result = fopen(buf, "wt"); FILE *result = fopen(buf, "wt");
if (result == NULL) { if (result == NULL) {
...@@ -840,6 +813,7 @@ void co_driver(be_chordal_env_t *cenv) ...@@ -840,6 +813,7 @@ void co_driver(be_chordal_env_t *cenv)
fclose(f); fclose(f);
} }
#if 0
/* if the algo can improve results, provide an initial solution with heur1 */ /* if the algo can improve results, provide an initial solution with heur1 */
if (improve && selected_copyopt->can_improve_existing) { if (improve && selected_copyopt->can_improve_existing) {
co_complete_stats_t stats; co_complete_stats_t stats;
...@@ -851,6 +825,7 @@ void co_driver(be_chordal_env_t *cenv) ...@@ -851,6 +825,7 @@ void co_driver(be_chordal_env_t *cenv)
co_complete_stats(co, &stats); co_complete_stats(co, &stats);
stat_ev_ull("co_prepare_costs", stats.costs); stat_ev_ull("co_prepare_costs", stats.costs);
} }
#endif
/* perform actual copy minimization */ /* perform actual copy minimization */
ir_timer_reset_and_start(timer); ir_timer_reset_and_start(timer);
......
...@@ -41,100 +41,4 @@ void be_register_copyopt(const char *name, co_algo_info *copyopt); ...@@ -41,100 +41,4 @@ void be_register_copyopt(const char *name, co_algo_info *copyopt);
/** The driver for copy minimization. */ /** The driver for copy minimization. */
void co_driver(be_chordal_env_t *cenv); void co_driver(be_chordal_env_t *cenv);
/**
* Generate the problem. Collect all information and optimizable nodes.
*/
copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env, cost_fct_t get_costs);
/**
* Free the space used...
*/
void free_copy_opt(copy_opt_t *co);
/**
* Statistics over a copy optimization module.
*/
typedef struct {
unsigned long long aff_edges; /**< number of affinity edges. */
unsigned long long aff_nodes; /**< number of nodes with incident affinity edges. */
unsigned long long aff_int; /**< number of affinity edges whose nodes also interfere. */
unsigned long long inevit_costs; /**< costs which cannot be evited (due to interfering affinities). */
unsigned long long max_costs; /**< all costs of the affinities. */
unsigned long long costs; /**< The costs of the current coloring. */
unsigned long long unsatisfied_edges; /**< The number of unequally colored affinity edges. */
} co_complete_stats_t;
/**
* Collect statistics of a copy optimization module.
* @param co The copy optimization environment.
* @param stat Where to put the stats.
* @note This requires the graph info to be computed.
*/
void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat);
/**
* Build internal optimization units structure
*/
void co_build_ou_structure(copy_opt_t *co);
/**
* Frees the space used by the opt unit representation.
* Does NOT free the whole copyopt structure
*/
void co_free_ou_structure(copy_opt_t *co);
/**
* Solves the problem using a heuristic approach
* Uses the OU data structure
*/
int co_solve_heuristic(copy_opt_t *co);
/**
* Returns the maximal costs possible, i.e. the costs if all
* pairs would be assigned different registers.
* Uses the OU data structure
*/
int co_get_max_copy_costs(const copy_opt_t *co);
/**
* Returns the inevitable costs, i.e. the costs of
* all copy pairs which interfere.
* Uses the OU data structure
*/
int co_get_inevit_copy_costs(const copy_opt_t *co);
/**
* Returns the current costs the copies are causing.
* The result includes inevitable costs and the costs
* of the copies regarding the current register allocation
* Uses the OU data structure
*/
int co_get_copy_costs(const copy_opt_t *co);
/**
* Returns a lower bound for the costs of copies in this ou.
* The result includes inevitable costs and the costs of a
* minimal costs caused by the nodes of the ou.
* Uses the OU data structure
*/
int co_get_lower_bound(const copy_opt_t *co);
/**
* Constructs another internal representation of the affinity edges
*/
void co_build_graph_structure(copy_opt_t *co);
/**
* Frees the space used by the graph representation.
* Does NOT free the whole copyopt structure
*/
void co_free_graph_structure(copy_opt_t *co);
/**
* Checks if a node is optimizable, viz has something to do with coalescing.
* Uses the GRAPH data structure
*/
int co_gs_is_optimizable(copy_opt_t const *co, ir_node *irn);
#endif #endif
...@@ -28,17 +28,16 @@ struct copy_opt_t { ...@@ -28,17 +28,16 @@ struct copy_opt_t {
be_chordal_env_t *cenv; be_chordal_env_t *cenv;
const arch_register_class_t *cls; const arch_register_class_t *cls;
ir_graph *irg; ir_graph *irg;
cost_fct_t get_costs; /**< function ptr used to get costs for copies */ cost_fct_t get_costs; /**< function ptr used to get costs for copies */
/** Representation as optimization units */ /** Representation as optimization units */
struct list_head units; /**< all units to optimize in specific order */ struct list_head units; /**< all units to optimize in specific order */
/** Representation in graph structure. Only build on demand */ /** Representation in graph structure. Only build on demand */
struct obstack obst; struct obstack obst;
set *nodes; set *nodes;
}; };
/* Helpers */
#define ASSERT_OU_AVAIL(co) assert((co)->units.next && "Representation as optimization-units not built") #define ASSERT_OU_AVAIL(co) assert((co)->units.next && "Representation as optimization-units not built")
#define ASSERT_GS_AVAIL(co) assert((co)->nodes && "Representation as graph not built") #define ASSERT_GS_AVAIL(co) assert((co)->nodes && "Representation as graph not built")
...@@ -54,72 +53,64 @@ static inline void set_irn_col(const arch_register_class_t *cls, ir_node *node, ...@@ -54,72 +53,64 @@ static inline void set_irn_col(const arch_register_class_t *cls, ir_node *node,
arch_set_irn_register(node, reg); arch_set_irn_register(node, reg);
} }
#define list_entry_units(lh) list_entry(lh, unit_t, units)
#define get_Perm_src(irn) (get_irn_n(get_Proj_pred(irn), get_Proj_proj(irn))) #define get_Perm_src(irn) (get_irn_n(get_Proj_pred(irn), get_Proj_proj(irn)))
#define is_Perm_Proj(irn) (is_Proj(irn) && be_is_Perm(get_Proj_pred(irn))) #define is_Perm_Proj(irn) (is_Proj(irn) && be_is_Perm(get_Proj_pred(irn)))
/****************************************************************************** /**
____ _ _ _ _ _ _____ _ * Returns the inevitable costs, i.e. the costs of
/ __ \ | | | | | | (_) | / ____| | * all copy pairs which interfere.
| | | |_ __ | |_| | | |_ __ _| |_ ___ | (___ | |_ ___ _ __ __ _ __ _ ___ * Uses the OU data structure
| | | | '_ \| __| | | | '_ \| | __/ __| \___ \| __/ _ \| '__/ _` |/ _` |/ _ \ */
| |__| | |_) | |_| |__| | | | | | |_\__ \ ____) | || (_) | | | (_| | (_| | __/ int co_get_inevit_copy_costs(const copy_opt_t *co);
\____/| .__/ \__|\____/|_| |_|_|\__|___/ |_____/ \__\___/|_| \__,_|\__, |\___|
| | __/ |
|_| |___/
******************************************************************************/
#define MIS_HEUR_TRIGGER 8 /**
* Returns a lower bound for the costs of copies in this ou.
* The result includes inevitable costs and the costs of a
* minimal costs caused by the nodes of the ou.
* Uses the OU data structure
*/
int co_get_lower_bound(const copy_opt_t *co);
/**
* Checks if a node is optimizable, viz has something to do with coalescing.
* Uses the GRAPH data structure
*/
bool co_gs_is_optimizable(copy_opt_t const *co, ir_node *irn);
typedef struct unit_t { typedef struct unit_t {
struct list_head units; /**< chain for all units */ struct list_head units; /**< chain for all units */
int node_count; /**< size of the nodes array */ int node_count; /**< size of the nodes array */
ir_node **nodes; /**< [0] is the root-node, others are non interfering args of it. */ ir_node **nodes; /**< [0] is the root-node, others are non interfering args of it. */
int *costs; /**< costs[i] are incurred, if nodes[i] has a different color */ int *costs; /**< costs[i] are incurred, if nodes[i] has a different color */
int inevitable_costs; /**< sum of costs of all args interfering with root */ int inevitable_costs; /**< sum of costs of all args interfering with root */
int all_nodes_costs; /**< sum of all costs[i] */ int all_nodes_costs; /**< sum of all costs[i] */
int min_nodes_costs; /**< a lower bound for the costs in costs[], determined by a max independent set */ int min_nodes_costs; /**< a lower bound for the costs in costs[], determined by a max independent set */
int sort_key; /**< maximum costs. controls the order of ou's in the struct list_head units. */ int sort_key; /**< maximum costs. controls the order of ou's in the struct list_head units. */
/* for heuristic */ /* for heuristic */
struct list_head queue; /**< list of qn's sorted by weight of qn-mis */ struct list_head queue; /**< list of qn's sorted by weight of qn-mis */
} unit_t; } unit_t;
typedef struct neighb_t neighb_t;
/******************************************************************************
_____ _ _____ _
/ ____| | | / ____| |
| | __ _ __ __ _ _ __ | |__ | (___ | |_ ___ _ __ __ _ __ _ ___
| | |_ | '__/ _` | '_ \| '_ \ \___ \| __/ _ \| '__/ _` |/ _` |/ _ \
| |__| | | | (_| | |_) | | | | ____) | || (_) | | | (_| | (_| | __/
\_____|_| \__,_| .__/|_| |_| |_____/ \__\___/|_| \__,_|\__, |\___|
| | __/ |
|_| |___/
******************************************************************************/
typedef struct neighb_t neighb_t;
typedef struct affinity_node_t affinity_node_t; typedef struct affinity_node_t affinity_node_t;
struct neighb_t { struct neighb_t {
neighb_t *next; /** the next neighbour entry*/ neighb_t *next; /** the next neighbour entry*/
const ir_node *irn; /** the neighbour itself */ const ir_node *irn; /** the neighbour itself */
int costs; /** the costs of the edge (affinity_node_t->irn, neighb_t->irn) */ int costs; /** the costs of the edge (affinity_node_t->irn, neighb_t->irn) */
}; };
struct affinity_node_t { struct affinity_node_t {
const ir_node *irn; /** a node with affinity edges */ const ir_node *irn; /** a node with affinity edges */
neighb_t *neighbours; /** a linked list of all affinity neighbours */ neighb_t *neighbours; /** a linked list of all affinity neighbours */
}; };
static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_node *irn) static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_node *irn)
{ {
affinity_node_t find;
ASSERT_GS_AVAIL(co); ASSERT_GS_AVAIL(co);
affinity_node_t find;
find.irn = irn; find.irn = irn;
return set_find(affinity_node_t, co->nodes, &find, sizeof(find), hash_irn(irn)); return set_find(affinity_node_t, co->nodes, &find, sizeof(find), hash_irn(irn));
} }
...@@ -127,4 +118,4 @@ static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_ ...@@ -127,4 +118,4 @@ static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node)) #define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
#define co_gs_foreach_neighb(aff_node, neighb) for (neighb_t *neighb = aff_node->neighbours; neighb; neighb = neighb->next) #define co_gs_foreach_neighb(aff_node, neighb) for (neighb_t *neighb = aff_node->neighbours; neighb; neighb = neighb->next)
#endif /* FIRM_BE_BECOPYOPT_T_H */ #endif
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "xmalloc.h" #include "xmalloc.h"
#include "becopystat.h" #include "becopystat.h"