fixed precedence constraint
[libfirm] / ir / be / belive.c
index 7e5121e..c9eda11 100644 (file)
@@ -119,7 +119,7 @@ static INLINE unsigned _be_liveness_bsearch(struct _be_lv_info_t *arr, unsigned
 #else
 
 /**
- * This function searches linearily for the node in the array.
+ * This function searches linearly for the node in the array.
  */
 static INLINE unsigned _be_liveness_bsearch(struct _be_lv_info_t *arr, unsigned idx) {
        unsigned n  = arr[0].u.head.n_members;
@@ -667,6 +667,7 @@ int be_check_dominance(ir_graph *irg)
 {
        int problem_found = 0;
 
+       assure_doms(irg);
        irg_walk_graph(irg, dom_check, NULL, &problem_found);
 
        return !problem_found;
@@ -733,3 +734,18 @@ pset *be_liveness_nodes_live_at(const be_lv_t *lv, const arch_env_t *arch_env, c
 
        return live;
 }
+
+pset *be_liveness_nodes_live_at_input(const be_lv_t *lv, const arch_env_t *arch_env, const arch_register_class_t *cls, const ir_node *pos, pset *live)
+{
+       const ir_node *bl = is_Block(pos) ? pos : get_nodes_block(pos);
+       ir_node *irn;
+
+       be_liveness_end_of_block(lv, arch_env, cls, bl, live);
+       sched_foreach_reverse(bl, irn) {
+               be_liveness_transfer(arch_env, cls, irn, live);
+               if(irn == pos)
+                       return live;
+       }
+
+       return live;
+}