summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaximilian Stemmer-Grabow <mail@mxsg.de>2021-07-12 17:26:15 +0200
committerAndreas Fried <andreas.fried@kit.edu>2021-12-02 12:57:28 +0100
commitea1fafd0e1eecb3558c25280e2b36b9bddc8fde5 (patch)
treed7b1bc6e1f30feae3f567cbedcaca7dff374c228
parent1fef3dea94425ef904db2292140be37ae8cec9ea (diff)
Rebased: Add pruned property to affinity edges
-rw-r--r--ir/be/becopyopt.c1
-rw-r--r--ir/be/becopyopt_t.h3
2 files changed, 4 insertions, 0 deletions
diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c
index bf3adeb..ce75dcb 100644
--- a/ir/be/becopyopt.c
+++ b/ir/be/becopyopt.c
@@ -583,6 +583,7 @@ static void add_edge(copy_opt_t *co, ir_node *n1, ir_node *n2, int costs, aff_ed
nbr->costs = 0;
nbr->aff_type = edge_type;
nbr->next = node->neighbours;
+ nbr->pruned = false;
node->neighbours = nbr;
}
diff --git a/ir/be/becopyopt_t.h b/ir/be/becopyopt_t.h
index 8191241..ce24264 100644
--- a/ir/be/becopyopt_t.h
+++ b/ir/be/becopyopt_t.h
@@ -100,6 +100,8 @@ struct neighb_t {
* This allows the copy minimization to distinguish between different
* reasons for there to be an affinity edge in this case. */
aff_edge_type_t aff_type;
+
+ bool pruned : 1; /**< Set if this edge was pruned and should be ignored. */
};
struct affinity_node_t {
@@ -130,5 +132,6 @@ static inline affinity_node_t *get_affinity_info(const copy_opt_t *co, const ir_
#define co_gs_foreach_aff_node(co, aff_node) foreach_set((co)->nodes, affinity_node_t, (aff_node))
#define co_gs_foreach_neighb(aff_node, neighb) for (neighb_t *neighb = aff_node->neighbours; neighb; neighb = neighb->next)
+// Todo Add another macro to be able to only iterate over neighbors connected via unpruned edges
#endif