summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-06-11 13:14:59 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commit6a06aa779348c701b0b344c6113b38c97bbcb2b3 (patch)
treee973c87c9a898a04eadb40e607efd579c4465762
parent9b8c0849f8dbe59779a2f2f2eba582ae25cf9974 (diff)
Add function to check for uses with a compression requirement
-rw-r--r--ir/be/becopyheur4.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c
index 3e3857d..31f2d48 100644
--- a/ir/be/becopyheur4.c
+++ b/ir/be/becopyheur4.c
@@ -32,6 +32,7 @@
#include "statev_t.h"
#include "bearch.h"
+#include "iredges.h"
#include "beifg.h"
#include "be_t.h"
#include "becopyopt_t.h"
@@ -143,6 +144,25 @@ static double scaled_edge_weight(const aff_edge_t * edge)
return result;
}
+static int compressable_uses_count(co_mst_env_t *env, const ir_node *irn)
+{
+ // To do this, we use the nodes' out edges, so verify they are correct
+ // Note: This is only required once, not for every node, but keep it here for now
+ assure_irg_properties(irn->irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
+
+ int comp_uses_count = 0;
+
+ foreach_out_edge(irn, edge) {
+ ir_node *const use = get_edge_src_irn(edge);
+
+ compression_req_t req = env->get_compression_reqs(use);
+ if (req == comp_req_register_subset || req == comp_req_2addr_register_subset) {
+ comp_uses_count++;
+ }
+ }
+ return comp_uses_count;
+}
+
/**
* In case there is no phase information for irn, initialize it.
*/