summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-07-05 16:53:19 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commite495626c3e963b24eb705593f88702aa892dabd3 (patch)
tree59c9dcebb5cab5050663dda77cbb70c9dc609d03
parent05c39447e14ad0ed63ec0dd101dfd87dc27fd7e6 (diff)
Port fix of color costs from regalloc-prune-compression-reqs branch
-rw-r--r--ir/be/becopyheur4.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c
index a65e4c2..acc3ef4 100644
--- a/ir/be/becopyheur4.c
+++ b/ir/be/becopyheur4.c
@@ -635,9 +635,10 @@ static void aff_chunk_assure_weight(co_mst_env_t *env, aff_chunk_t *c)
double prior_cost = c->color_affinity[i].cost * (1.0 / ARR_LEN(c->n));
double adjusted_cost = prior_cost;
- // If the register is not compressible, adjust the cost upwards according to the compressibility factor,
- // up to a maximum set by the compressibility influence parameter.
- if (!bitset_is_set(env->compressible_regs, i)) {
+ // Adjust the cost between compressible and non-compressible registers,
+ // according to the compressibility factor, up to a maximum set by the
+ // compressibility influence parameter.
+ if (bitset_is_set(env->compressible_regs, i)) {
adjusted_cost += prior_cost * compressibility_factor * compressibility_influence;
DB((dbg, LEVEL_4, "(%u: %d -> %d)", i, prior_cost, adjusted_cost));
}
@@ -1170,9 +1171,10 @@ static void color_aff_chunk(co_mst_env_t *env, aff_chunk_t *c)
double prior_cost = (1.0 - dislike_influence) * c->color_affinity[i].cost + dislike_influence * dislike;
double adjusted_cost = prior_cost;
- // If the register is not compressible, adjust the cost upwards according to the compressibility factor,
- // up to a maximum set by the compressibility influence parameter.
- if (!bitset_is_set(env->compressible_regs, i)) {
+ // Adjust the cost between compressible and non-compressible registers,
+ // according to the compressibility factor, up to a maximum set by the
+ // compressibility influence parameter.
+ if (bitset_is_set(env->compressible_regs, i)) {
adjusted_cost += prior_cost * compressibility_factor * compressibility_influence;
}