Use backtracking in find_original_value() for the flags emitter.
[libfirm] / ir / be / bechordal.c
index 6df7999..f0731d6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -77,12 +77,12 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 typedef struct _be_chordal_alloc_env_t {
        be_chordal_env_t *chordal_env;
 
-       pset *pre_colored;              /**< Set of precolored nodes. */
-       bitset_t *live;                             /**< A liveness bitset. */
-       bitset_t *tmp_colors;           /**< An auxiliary bitset which is as long as the number of colors in the class. */
-       bitset_t *colors;                           /**< The color mask. */
-       bitset_t *in_colors;            /**< Colors used by live in values. */
-       int colors_n;                   /**< The number of colors. */
+       pset *pre_colored;     /**< Set of precolored nodes. */
+       bitset_t *live;            /**< A liveness bitset. */
+       bitset_t *tmp_colors;  /**< An auxiliary bitset which is as long as the number of colors in the class. */
+       bitset_t *colors;          /**< The color mask. */
+       bitset_t *in_colors;   /**< Colors used by live in values. */
+       int colors_n;          /**< The number of colors. */
 } be_chordal_alloc_env_t;
 
 #include "fourcc.h"
@@ -157,7 +157,7 @@ static INLINE border_t *border_add(be_chordal_env_t *env, struct list_head *head
        else {
                b = get_irn_link(irn);
 
-               assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered");
+               DEBUG_ONLY(assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered"));
        }
 
        b->pressure = pressure;
@@ -310,7 +310,7 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
                }
        }
 
-       /* collect all registers occuring in out constraints. */
+       /* collect all registers occurring in out constraints. */
        for(i = 0; i < insn->use_start; ++i) {
                be_operand_t *op = &insn->ops[i];
                if(op->has_constraints)
@@ -332,7 +332,7 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
                        Check, if
                        1) the operand is constrained.
                        2) lives through the node.
-                       3) is constrained to a register occuring in out constraints.
+                       3) is constrained to a register occurring in out constraints.
                */
                if(!op->has_constraints ||
                   !values_interfere(birg, insn->irn, op->carrier) ||
@@ -1012,6 +1012,8 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
        env.in_colors     = bitset_alloca(colors_n);
        env.pre_colored   = pset_new_ptr_default();
 
+       BE_TIMER_PUSH(t_constr);
+
        /* Handle register targeting constraints */
        dom_tree_walk_irg(irg, constraints, NULL, &env);
 
@@ -1020,6 +1022,8 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
                be_dump(chordal_env->irg, buf, dump_ir_block_graph_sched);
        }
 
+       BE_TIMER_POP(t_constr);
+
        env.live = bitset_malloc(get_irg_last_idx(chordal_env->irg));
 
        /* First, determine the pressure */