X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespillmorgan.c;h=fffc61d386290c156d5c9628872847c3b6e6676c;hb=71bc30a686cae0ee22cc4a987c3f199a629b971a;hp=d43b91deb08269ed36275039d74e6095c282b96c;hpb=f94d292525ff2eb4b35dfcb1977612aa9deca775;p=libfirm diff --git a/ir/be/bespillmorgan.c b/ir/be/bespillmorgan.c index d43b91deb..fffc61d38 100644 --- a/ir/be/bespillmorgan.c +++ b/ir/be/bespillmorgan.c @@ -33,6 +33,7 @@ #include "irgraph_t.h" #include "irprintf.h" #include "obst.h" +#include "error.h" #include "bespillmorgan.h" #include "bechordal_t.h" @@ -314,7 +315,10 @@ static void construct_block_livethrough_unused(ir_node *block, void *data) { /* * All values that are used within the block are not unused (and therefore not * livethrough_unused) + * + * TODO FIXME use block out edges and not schedule to find uses */ + panic("needs fixing"); sched_foreach(block, node) { int i, arity; @@ -409,14 +413,14 @@ static bitset_t *construct_loop_livethrough_unused(morgan_env_t *env, const ir_l typedef struct _spillcandidate_t { ir_node *node; - int cost; + double cost; } spillcandidate_t; static int compare_spillcandidates(const void *d1, const void *d2) { const spillcandidate_t *cand1 = d1; const spillcandidate_t *cand2 = d2; - return cand1->cost - cand2->cost; + return (int)(cand1->cost - cand2->cost); } static void spill_values(morgan_env_t *env, const loop_attr_t *loop_attr, int spills) { @@ -432,17 +436,17 @@ static void spill_values(morgan_env_t *env, const loop_attr_t *loop_attr, int sp candidates = alloca(sizeof(candidates[0]) * candidatecount); DBG((dbg, DBG_CHOOSE, "Candidates for loop %d\n", get_loop_loop_nr(loop_attr->loop))); - // build candidiatelist + // build candidiate list c = 0; bitset_foreach(cand_bitset, idx) { ir_node *node = get_idx_irn(env->irg, idx); candidates[c].node = node; - candidates[c].cost = 0; + candidates[c].cost = 0.0; for(edge = set_first(loop_attr->out_edges); edge != NULL; edge = set_next(loop_attr->out_edges)) { candidates[c].cost += be_get_reload_costs_on_edge(env->senv, node, edge->block, edge->pos); } - DBG((dbg, DBG_CHOOSE, "%+F has costs %d\n", node, candidates[c].cost)); + DBG((dbg, DBG_CHOOSE, "%+F has costs %f\n", node, candidates[c].cost)); c++; }