summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bespillslots.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-07-16 16:50:42 +0200
committerMatthias Braun <matze@braunis.de>2014-07-18 10:04:11 +0200
commit2ef7259cb0cb2e12a25a16892cdfaa17a63de3e8 (patch)
treec5c84b25b8fcf7acd55b05fbc7e77d4fe8b6073b /ir/be/bespillslots.c
parent6097e32cc4322ca2deb7a3b569418a6a125d6885 (diff)
bespillslots: move memory value interference check to belive
Diffstat (limited to 'ir/be/bespillslots.c')
-rw-r--r--ir/be/bespillslots.c67
1 files changed, 1 insertions, 66 deletions
diff --git a/ir/be/bespillslots.c b/ir/be/bespillslots.c
index 3ae1f23..4a8a5db 100644
--- a/ir/be/bespillslots.c
+++ b/ir/be/bespillslots.c
@@ -273,71 +273,6 @@ static int merge_interferences(be_fec_env_t *env, bitset_t** interferences,
return res;
}
-static bool live_at_user(const ir_node *const users_of,
- const ir_node *const node, const ir_node *const bb)
-{
- foreach_out_edge(users_of, edge) {
- const ir_node *const user = get_edge_src_irn(edge);
- if (is_Sync(user))
- return live_at_user(user, node, bb);
- if (get_nodes_block(user) == bb && !is_Phi(user)
- && sched_comes_before(node, user))
- return true;
- }
- return false;
-}
-
-static const ir_node *get_highest_sync_op(const ir_node *sync)
-{
- const ir_node *best = get_irn_n(sync, 0);
- for (int i = 1, arity = get_irn_arity(sync); i < arity; ++i) {
- const ir_node *other = get_irn_n(sync, i);
- if (is_Sync(other))
- other = get_highest_sync_op(other);
- if (value_strictly_dominates(other, best))
- best = other;
- }
- return best;
-}
-
-static bool memory_values_interfere(const ir_node *a, const ir_node *b)
-{
- if (is_Sync(a))
- a = get_highest_sync_op(a);
- if (is_Sync(b))
- b = get_highest_sync_op(b);
-
- if (value_strictly_dominates(b, a)) {
- /* Adjust a and b so, that a dominates b if
- * a dominates b or vice versa. */
- ir_node const *const t = a;
- a = b;
- b = t;
- } else if (!value_strictly_dominates(a, b)) {
- /* If there is no dominance relation, they do not interfere. */
- return false;
- }
-
- /* If a is live end in b's block it is
- * live at b's definition (a dominates b) */
- const ir_node *const bb = get_nodes_block(b);
- const ir_graph *const irg = get_Block_irg(bb);
- const be_lv_t *const lv = be_get_irg_liveness(irg);
- if (be_is_live_end(lv, bb, a))
- return true;
-
- /* Look at all usages of a.
- * If there's one usage of a in the block of b, then
- * we check, if this use is dominated by b, if that's true
- * a and b interfere. Note that b must strictly dominate the user,
- * since if b is the last user of in the block, b and a do not
- * interfere.
- * Uses of a not in b's block can be disobeyed, because the
- * check for a being live at the end of b's block is already
- * performed. */
- return live_at_user(a, b, bb);
-}
-
/**
* A greedy coalescing algorithm for spillslots:
* 1. Sort the list of affinity edges
@@ -376,7 +311,7 @@ static void do_greedy_coalescing(be_fec_env_t *env)
if (is_NoMem(spill2))
continue;
- if (memory_values_interfere(spill1, spill2)) {
+ if (be_memory_values_interfere(spill1, spill2)) {
DB((dbg, DBG_INTERFERENCES,
"Slot %d and %d interfere\n", i, i2));