#include "xmalloc.h"
#include "pdeq.h"
#include "irprintf.h"
-#include "irbitset.h"
#include "util.h"
#include "irtools.h"
#include "error.h"
#include "list.h"
#include "statev.h"
-#include "irbitset.h"
-
#include "bearch.h"
#include "beifg.h"
#include "be_t.h"
}
if (max_node) {
- bitset_t *visited = bitset_irg_malloc(env->co->irg);
+ bitset_t *visited = bitset_malloc(get_irg_last_idx(env->co->irg));
for (i = ARR_LEN(chunk->n); i != 0;)
- bitset_add_irn(visited, chunk->n[--i]);
+ bitset_set(visited, get_irn_idx(chunk->n[--i]));
pqueue_put(grow, (void *) max_node, max_weight);
- bitset_remv_irn(visited, max_node);
+ bitset_clear(visited, get_irn_idx(max_node));
i = 0;
while (!pqueue_empty(grow)) {
ir_node *irn = (ir_node*)pqueue_pop_front(grow);
co_gs_foreach_neighb(an, neigh) {
co_mst_irn_t *node = get_co_mst_irn(env, neigh->irn);
- if (bitset_contains_irn(visited, node->irn)) {
+ if (bitset_is_set(visited, get_irn_idx(node->irn))) {
pqueue_put(grow, (void *) neigh->irn, neigh->costs);
- bitset_remv_irn(visited, node->irn);
+ bitset_clear(visited, get_irn_idx(node->irn));
}
}
}
*/
static aff_chunk_t *fragment_chunk(co_mst_env_t *env, int col, aff_chunk_t *c, waitq *tmp)
{
- bitset_t *visited = bitset_irg_malloc(env->co->irg);
+ bitset_t *visited = bitset_malloc(get_irg_last_idx(env->co->irg));
int idx, len;
aff_chunk_t *best = NULL;
*/
for (i = 0; i < env->k; ++i) {
int col = order[i].col;
- waitq *good_starts = new_waitq();
+ waitq *good_starts;
aff_chunk_t *local_best;
int n_succeeded;
DB((dbg, LEVEL_2, "\ttrying color %d\n", col));
n_succeeded = 0;
+ good_starts = new_waitq();
/* try to bring all nodes of given chunk to the current color. */
for (idx = 0, len = ARR_LEN(c->n); idx < len; ++idx) {
}
/* try next color when failed */
- if (n_succeeded == 0)
+ if (n_succeeded == 0) {
+ del_waitq(good_starts);
continue;
+ }
/* fragment the chunk according to the coloring */
local_best = fragment_chunk(env, col, c, tmp_chunks);
}
/* fragment the remaining chunk */
- visited = bitset_irg_malloc(env->co->irg);
+ visited = bitset_malloc(get_irg_last_idx(env->co->irg));
for (idx = 0, len = ARR_LEN(best_chunk->n); idx < len; ++idx)
bitset_set(visited, get_irn_idx(best_chunk->n[idx]));