Cosmetics, changed loop-costs to d^2+1.
authorDaniel Grund <grund@cs.uni-saarland.de>
Tue, 23 Aug 2005 15:30:01 +0000 (15:30 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Tue, 23 Aug 2005 15:30:01 +0000 (15:30 +0000)
ir/be/becopyheur.c
ir/be/becopyopt.c

index 1194d13..4659f8f 100644 (file)
@@ -380,6 +380,7 @@ static int qnode_try_color(const qnode_t *qn) {
 /**
  * Determines a maximum weighted independent set with respect to
  * the interference and conflict edges of all nodes in a qnode.
+ * TODO: This runs in 2^n in worst case. Use a heuristic iff n>???
  */
 static INLINE void qnode_max_ind_set(qnode_t *qn, const unit_t *ou) {
        ir_node **safe, **unsafe;
index f8c5283..e719371 100644 (file)
@@ -35,6 +35,7 @@ static firm_dbg_module_t *dbg = NULL;
 /**
  * Determines a maximum weighted independent set with respect to
  * the interference and conflict edges of all nodes in a qnode.
+ * TODO: This runs in 2^n in worst case. Use a heuristic iff n>???
  */
 static int ou_max_ind_set_costs(unit_t *ou) {
        be_chordal_env_t *chordal_env = ou->co->chordal_env;
@@ -275,8 +276,10 @@ int get_costs_loop_depth(ir_node *root, ir_node* arg, int pos) {
                /* for phis the copies are placed in the corresponding pred-block */
                loop = get_irn_loop(get_Block_cfgpred_block(root_block, pos));
        }
-       if (loop)
-               cost = 2*get_loop_depth(loop);
+       if (loop) {
+               int d = get_loop_depth(loop);
+               cost = d*d;
+       }
        return cost+1;
 }