summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bera.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2007-03-26 10:49:26 +0200
committerMatthias Braun <matze@braunis.de>2007-03-26 10:49:26 +0200
commit87965f5c94d561cb15233b80711123f6edc80b30 (patch)
treefad665866bddae07e8bc7aa71125db1cdec96fcd /ir/be/bera.c
parent30d9c3e792a320a0d08b77ee0fc9de669a393bcc (diff)
rewritten be_ssa_constr which isn't using sets anymore, started working on a 'state' register type
Diffstat (limited to 'ir/be/bera.c')
-rw-r--r--ir/be/bera.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/ir/be/bera.c b/ir/be/bera.c
index fe36642..b77b2e0 100644
--- a/ir/be/bera.c
+++ b/ir/be/bera.c
@@ -24,7 +24,8 @@
be_ra_timer_t *global_ra_timer = NULL;
-static sched_timestep_t get_time_step(const ir_node *irn)
+static inline
+sched_timestep_t get_time_step(const ir_node *irn)
{
if(is_Phi(irn))
return 0;
@@ -32,29 +33,31 @@ static sched_timestep_t get_time_step(const ir_node *irn)
return sched_get_time_step(irn);
}
+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(const ir_node *a, const ir_node *b)
{
- int res = 0;
- const ir_node *ba = get_block(a);
- const ir_node *bb = get_block(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(ba != bb) {
- res = block_dominates(ba, bb);
+ if(block_a != block_b) {
+ return block_dominates(block_a, block_b);
+ }
/*
* Dominance is determined by the time steps of the schedule.
*/
- } else {
- sched_timestep_t as = get_time_step(a);
- sched_timestep_t bs = get_time_step(b);
- res = as <= bs;
- }
-
- return res;
+ return value_dominates_intrablock(a, b);
}
/**