summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-07-27 20:35:54 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commit7524dfbf2983bc938186b2cb92c7b25523464446 (patch)
tree70a4d4b5c6787be06555338384df975eaaec3a8a
parent4da4de878dadac5a46a2e4eb6797e0b662195880 (diff)
Add function to check for number of uses
-rw-r--r--ir/be/becopyheur4.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c
index 4252a1a..eff6571 100644
--- a/ir/be/becopyheur4.c
+++ b/ir/be/becopyheur4.c
@@ -176,6 +176,22 @@ static int compressable_uses_count(co_mst_env_t *env, const ir_node *irn)
return comp_uses_count;
}
+static int 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
+ // Todo Move this to initialization as the irg structure is not changed here
+ assure_irg_properties(irn->irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
+
+ int uses_count = 0;
+
+ foreach_out_edge(irn, edge) {
+ ir_node *const use = get_edge_src_irn(edge);
+ uses_count++;
+ }
+ return uses_count;
+}
+
/**
* In case there is no phase information for irn, initialize it.
*/