summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-07-27 20:36:29 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commit89f5f620a1adb7b94be3a7099d27ef5b58a9ff00 (patch)
tree1b4f9a419980961994a24b28405550df7b421edf
parent7524dfbf2983bc938186b2cb92c7b25523464446 (diff)
Restrict insertion of compression affinities to nodes with few uses
-rw-r--r--ir/be/becopyheur4.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c
index eff6571..be184bb 100644
--- a/ir/be/becopyheur4.c
+++ b/ir/be/becopyheur4.c
@@ -768,6 +768,8 @@ static void build_affinity_chunks(co_mst_env_t *env)
/* build the affinity edges */
co_gs_foreach_neighb(an, neigh) {
const ir_node *m = neigh->irn;
+ aff_edge_type_t edge_type = neigh->aff_type;
+
unsigned m_idx = get_irn_idx(m);
/* record the edge in only one direction */
@@ -783,7 +785,22 @@ static void build_affinity_chunks(co_mst_env_t *env)
}
edge.unscaled_weight = neigh->costs;
- edge.weight = edge.unscaled_weight * compression_cost_scale;
+ edge.weight = edge.unscaled_weight;
+ edge.edge_type = edge_type;
+
+ // Scale only when the edge is used for compression
+ if (edge_type == aff_edge_compression) {
+ edge.weight = edge.unscaled_weight * compression_cost_scale;
+
+ // For now, skip compression edges with many uses
+ // These are less likely to be fulfilled, so we try to fulfill the ones with the highest chance
+ unsigned uses = uses_count(env, m);
+
+ if (uses > 2) {
+ continue;
+ }
+ }
+
edge.pruned = false;