summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bera.c
diff options
context:
space:
mode:
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>2007-05-10 17:43:44 +0200
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>2007-05-10 17:43:44 +0200
commit8eee0e6361868153ae82c8d8bdda1446a9af9084 (patch)
treebcf002f199c23043548471a69935263e95d72c2e /ir/be/bera.c
parent73660ffae4a673bc11dba89455ecba9b80938298 (diff)
* Added a new file: beintlive_t.h which subsumes all interferene/liveness checks
- it uses the new liveness checking algos in ana/irlivechk.h - value_dominates, etc. was erased from bera.h because it does not belong there * bechordal.c features an experimental coloring (by defualt disabled by macro) which can color the routine in a single pass without building the "borders". A long term goal is to disable borders completely but they are used in other places, too. * The 1st parameter of values_interfere is now a birg and not a be_lv_t. There is now a special routine lv_values_interfere() for those who want to use the computed liveness explicitly. changing the parameter makes it more easy to switch to other liveness implementations. All other files were modified to respect the changes [r13762]
Diffstat (limited to 'ir/be/bera.c')
-rw-r--r--ir/be/bera.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/ir/be/bera.c b/ir/be/bera.c
index b776366..b673bef 100644
--- a/ir/be/bera.c
+++ b/ir/be/bera.c
@@ -46,95 +46,6 @@
be_ra_timer_t *global_ra_timer = NULL;
-#define get_time_step(irn) (is_Phi(irn) ? 0 : sched_get_time_step(irn))
-
-static INLINE int _value_dominates_intrablock(const ir_node *a, const ir_node *b)
-{
- sched_timestep_t as = get_time_step(a);
- sched_timestep_t bs = get_time_step(b);
- return as <= bs;
-}
-
-int value_dominates_intrablock(const ir_node *a, const ir_node *b)
-{
- return _value_dominates_intrablock(a, b);
-}
-
-int value_dominates(const ir_node *a, const ir_node *b)
-{
- const ir_node *block_a = get_block(a);
- const ir_node *block_b = get_block(b);
-
- /*
- * a and b are not in the same block,
- * so dominance is determined by the dominance of the blocks.
- */
- if(block_a != block_b) {
- return block_dominates(block_a, block_b);
- }
-
- /*
- * Dominance is determined by the time steps of the schedule.
- */
- return _value_dominates_intrablock(a, b);
-}
-
-/**
- * Check, if two values interfere.
- * @param a The first value.
- * @param b The second value.
- * @return 1, if a and b interfere, 0 if not.
- */
-int values_interfere(const be_lv_t *lv, const ir_node *a, const ir_node *b)
-{
- int a2b = value_dominates(a, b);
- int b2a = value_dominates(b, a);
-
- /* If there is no dominance relation, they do not interfere. */
- if((a2b | b2a) > 0) {
- const ir_edge_t *edge;
- ir_node *bb;
-
- /*
- * Adjust a and b so, that a dominates b if
- * a dominates b or vice versa.
- */
- if(b2a) {
- const ir_node *t = a;
- a = b;
- b = t;
- }
-
- bb = get_nodes_block(b);
-
- /*
- * If a is live end in b's block it is
- * live at b's definition (a dominates b)
- */
- if(be_is_live_end(lv, bb, a))
- return 1;
-
- /*
- * 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.
- */
- foreach_out_edge(a, edge) {
- const ir_node *user = get_edge_src_irn(edge);
- if(get_nodes_block(user) == bb && !is_Phi(user) && b != user && value_dominates(b, user))
- return 1;
- }
- }
-
- return 0;
-}
-
/** The list of register allocators */
static be_module_list_entry_t *register_allocators = NULL;
static be_ra_t *selected_allocator = NULL;