summaryrefslogtreecommitdiffhomepage
path: root/ir/be/becopyheur4.c
diff options
context:
space:
mode:
Diffstat (limited to 'ir/be/becopyheur4.c')
-rw-r--r--ir/be/becopyheur4.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c
index fce299d..852feff 100644
--- a/ir/be/becopyheur4.c
+++ b/ir/be/becopyheur4.c
@@ -59,6 +59,7 @@ typedef float real_t;
static unsigned last_chunk_id;
static int recolor_limit = 7;
static double dislike_influence = REAL(0.1);
+static bool consider_recolor_count_in_chunk_weight = true;
typedef struct col_cost_t {
unsigned col;
@@ -803,6 +804,16 @@ static aff_chunk_t *fragment_chunk(co_mst_env_t *env, unsigned col,
}
static int get_recolor_count_for_color(co_mst_env_t *env, aff_chunk_t *chunk, unsigned int color) {
+ if (!consider_recolor_count_in_chunk_weight) {
+ return 0;
+ }
+
+ DBG((dbg, LEVEL_1, "Fetching recolver for %d\n", chunk->id));
+ for (size_t idx = 0, len = ARR_LEN(chunk->n); idx < len; ++idx) {
+ DB((dbg, LEVEL_1, ", %+F", chunk->n[idx]));
+ }
+ DB((dbg, LEVEL_1, "\n"));
+
deq_t tmp_chunks;
deq_init(&tmp_chunks);
@@ -812,7 +823,7 @@ static int get_recolor_count_for_color(co_mst_env_t *env, aff_chunk_t *chunk, un
int weight = 0;
if (best) {
aff_chunk_assure_weight(env, best);
- weight = best->weight;
+ weight = (int) best->weight;
}
while (!deq_empty(&tmp_chunks)) {