From: Christian Würdig Date: Fri, 23 Feb 2007 17:47:02 +0000 (+0000) Subject: removed dependency on chordal_env X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=111132c624cc0db52da15f582d2f3c60adf4f968;p=libfirm removed dependency on chordal_env removed unused code --- diff --git a/ir/be/bespillslots.c b/ir/be/bespillslots.c index 4459e80d7..2b3ece63d 100644 --- a/ir/be/bespillslots.c +++ b/ir/be/bespillslots.c @@ -236,47 +236,6 @@ static int merge_interferences(be_fec_env_t *env, bitset_t** interferences, return res; } -#if 0 -static void dump_interference_graph(be_fec_env_t *env, bitset_t **interferences, const char* suffix) { - char name[256]; - int i; - int spillcount; - spill_t *spill; - FILE *f; - static int cnt = 0; - - snprintf(name, sizeof(name), "%d-%s-spillslots-%s.vcg", cnt++, get_irg_dump_name(env->chordal_env->birg->irg), suffix); - - f = fopen(name, "w"); - assert(f != NULL); - - fprintf(f, "graph: {\n"); - - spillcount = set_count(env->spills); - for(spill = set_first(env->spills), i = 0; spill != NULL; spill = set_next(env->spills), ++i) { - int slotid = spill->spillslot; - fprintf(f, "\tnode: { title: \"n%d\" label: \"%d\" }\n", i, slotid); - } - - for(i = 0; i < ARR_LEN(env->affinity_edges); ++i) { - affinity_edge_t *edge = env->affinity_edges[i]; - fprintf(f, "\tedge: { sourcename: \"n%d\" targetname: \"n%d\" color: green }\n", edge->slot1, edge->slot2); - } - - for(i = 0; i < spillcount; ++i) { - int i2; - for(i2 = 0; i2 < spillcount; ++i2) { - if(bitset_is_set(interferences[i], i2)) { - fprintf(f, "\tedge: { sourcename: \"n%d\" targetname: \"n%d\" color: red }\n", i, i2); - } - } - } - - fprintf(f, "}\n"); - fclose(f); -} -#endif - /** * A greedy coalescing algorithm for spillslots: * 1. Sort the list of affinity edges @@ -744,12 +703,12 @@ static void collect_spills_walker(ir_node *node, void *data) be_node_needs_frame_entity(env, node, mode, align); } -void be_coalesce_spillslots(const be_chordal_env_t *chordal_env) +void be_coalesce_spillslots(be_irg_t *birg) { - be_fec_env_t *env = be_new_frame_entity_coalescer(chordal_env->birg); + be_fec_env_t *env = be_new_frame_entity_coalescer(birg); /* collect reloads */ - irg_walk_graph(chordal_env->irg, NULL, collect_spills_walker, env); + irg_walk_graph(birg->irg, NULL, collect_spills_walker, env); be_assign_entities(env); diff --git a/ir/be/bespillslots.h b/ir/be/bespillslots.h index b75695a97..19b26a016 100644 --- a/ir/be/bespillslots.h +++ b/ir/be/bespillslots.h @@ -7,7 +7,7 @@ #ifndef BESPILLSLOTS_H_ #define BESPILLSLOTS_H_ -#include "bechordal.h" +#include "beirg.h" typedef struct _be_fec_env_t be_fec_env_t; @@ -49,6 +49,6 @@ void be_assign_entities(be_fec_env_t *env); * Coalesces spillslots and minimizes the number of memcopies induced by * memory-phis. */ -void be_coalesce_spillslots(const be_chordal_env_t *chordal_env); +void be_coalesce_spillslots(be_irg_t *birg); -#endif +#endif /* BESPILLSLOTS_H_ */