From e4a6094bd9204ada5d9d01d132478e1eb1663afe Mon Sep 17 00:00:00 2001 From: Daniel Grund Date: Tue, 23 Aug 2005 15:30:01 +0000 Subject: [PATCH] Cosmetics, changed loop-costs to d^2+1. --- ir/be/becopyheur.c | 1 + ir/be/becopyopt.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ir/be/becopyheur.c b/ir/be/becopyheur.c index 1194d1375..4659f8f90 100644 --- a/ir/be/becopyheur.c +++ b/ir/be/becopyheur.c @@ -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; diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index f8c5283d3..e71937118 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -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; } -- 2.20.1