Commit 0c92b911 authored by Matthias Braun's avatar Matthias Braun
Browse files

- New belady variant (see my diploma thesis + presentation)

- refactored backend to store some analysis info about the irg in the be_irg structure, added assure_ and invalidate_ functions for this
parent 88e8acd0
......@@ -67,14 +67,26 @@ struct _be_main_env_t {
DEBUG_ONLY(firm_dbg_module_t *dbg;)
};
/**
* An irg with additional analysis data about this irg. Also includes some
* backend structures
*/
struct _be_irg_t {
ir_graph *irg;
struct _be_main_env_t *main_env;
struct _be_abi_irg_t *abi;
struct _arch_code_generator_t *cg;
ir_exec_freq *execfreqs;
ir_exec_freq *exec_freq;
be_dom_front_info_t *dom_front;
be_lv_t *lv;
};
void be_assure_liveness(be_irg_t *birg);
void be_invalidate_liveness(be_irg_t *birg);
void be_assure_dom_front(be_irg_t *birg);
void be_invalidate_dom_front(be_irg_t *birg);
/**
* Put the registers to be ignored in this IRG into a bitset.
* @param birg The backend IRG data structure.
......
......@@ -60,7 +60,7 @@ struct _be_abi_call_t {
struct _be_abi_irg_t {
struct obstack obst;
be_stack_layout_t *frame; /**< The stack frame model. */
const be_irg_t *birg; /**< The back end IRG. */
be_irg_t *birg; /**< The back end IRG. */
const arch_isa_t *isa; /**< The isa. */
survive_dce_t *dce_survivor;
......@@ -1880,22 +1880,18 @@ static void collect_stack_nodes_walker(ir_node *irn, void *data)
void be_abi_fix_stack_nodes(be_abi_irg_t *env, be_lv_t *lv)
{
dom_front_info_t *df;
pset *stack_nodes = pset_new_ptr(16);
struct fix_stack_walker_info info;
info.nodes = stack_nodes;
info.aenv = env->birg->main_env->arch_env;
/* We need dominance frontiers for fix up */
df = be_compute_dominance_frontiers(env->birg->irg);
be_assure_dom_front(env->birg);
irg_walk_graph(env->birg->irg, collect_stack_nodes_walker, NULL, &info);
pset_insert_ptr(stack_nodes, env->init_sp);
be_ssa_constr_set_phis(df, lv, stack_nodes, env->stack_phis);
be_ssa_constr_set_phis(env->birg->dom_front, lv, stack_nodes, env->stack_phis);
del_pset(stack_nodes);
/* free these dominance frontiers */
be_free_dominance_frontiers(df);
}
static int process_stack_bias(be_abi_irg_t *env, ir_node *bl, int bias)
......
......@@ -491,8 +491,6 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
{
int i;
int edge_count = ARR_LEN(env->ilpedges);
FILE *f;
char fname[256];
/* complete out constraints */
for(i = 0; i < edge_count; ++i) {
......@@ -513,11 +511,18 @@ static void coalesce_blocks_ilp(blocksched_ilp_env_t *env)
lpp_set_factor_fast(env->lpp, entry->out_cst, edge->ilpvar, 1.0);
}
lpp_dump(env->lpp, "lpp.out");
snprintf(fname, sizeof(fname), "lpp_%s.plain", get_irg_dump_name(env->env.irg));
f = fopen(fname, "w");
lpp_dump_plain(env->lpp, f);
fclose(f);
#if 0
{
FILE *f;
char fname[256];
lpp_dump(env->lpp, "lpp.out");
snprintf(fname, sizeof(fname), "lpp_%s.plain", get_irg_dump_name(env->env.irg));
f = fopen(fname, "w");
lpp_dump_plain(env->lpp, f);
fclose(f);
}
#endif
//lpp_solve_net(env->lpp, main_env->options->ilp_server, main_env->options->ilp_solver);
lpp_solve_net(env->lpp, "i44pc52", "cplex");
assert(lpp_is_sol_valid(env->lpp));
......
......@@ -227,6 +227,7 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
bitset_t *def_constr = bitset_alloca(env->cls->n_regs);
bitset_t *tmp = bitset_alloca(env->cls->n_regs);
ir_node *bl = get_nodes_block(irn);
be_lv_t *lv = env->birg->lv;
be_insn_t *insn;
int i, j;
......@@ -308,7 +309,7 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
2) lives through the node.
3) is constrained to a register occuring in out constraints.
*/
if(op->has_constraints && values_interfere(env->lv, insn->irn, op->carrier) && bitset_popcnt(tmp) > 0) {
if(op->has_constraints && values_interfere(lv, insn->irn, op->carrier) && bitset_popcnt(tmp) > 0) {
/*
only create the copy if the operand is no copy.
this is necessary since the assure constraints phase inserts
......@@ -321,7 +322,7 @@ static ir_node *prepare_constr_insn(be_chordal_env_t *env, ir_node *irn)
sched_add_before(insn->irn, copy);
set_irn_n(insn->irn, op->pos, copy);
DBG((env->dbg, LEVEL_3, "inserting constr copy %+F for %+F pos %d\n", copy, insn->irn, op->pos));
be_liveness_update(env->lv, op->carrier);
be_liveness_update(lv, op->carrier);
}
}
}
......@@ -352,6 +353,7 @@ static void pair_up_operands(const be_chordal_alloc_env_t *alloc_env, be_insn_t
int n_defs = be_insn_n_defs(insn);
bitset_t *bs = bitset_alloca(env->cls->n_regs);
int *pairing = alloca(MAX(n_defs, n_uses) * sizeof(pairing[0]));
be_lv_t *lv = env->birg->lv;
int i, j;
......@@ -369,7 +371,7 @@ static void pair_up_operands(const be_chordal_alloc_env_t *alloc_env, be_insn_t
int n_total;
const be_operand_t *op = &insn->ops[i];
if (! values_interfere(env->lv, op->irn, op->carrier) && ! op->partner) {
if (! values_interfere(lv, op->irn, op->carrier) && ! op->partner) {
bitset_clear_all(bs);
bitset_copy(bs, op->regs);
bitset_and(bs, out_op->regs);
......@@ -401,6 +403,7 @@ static ir_node *pre_process_constraints(be_chordal_alloc_env_t *alloc_env, be_in
ir_node *perm = NULL;
bitset_t *out_constr = bitset_alloca(env->cls->n_regs);
bitset_t *bs = bitset_alloca(env->cls->n_regs);
be_lv_t *lv = env->birg->lv;
DEBUG_ONLY(firm_dbg_module_t *dbg = alloc_env->constr_dbg;)
int i;
......@@ -428,7 +431,7 @@ static ir_node *pre_process_constraints(be_chordal_alloc_env_t *alloc_env, be_in
Make the Perm, recompute liveness and re-scan the insn since the
in operands are now the Projs of the Perm.
*/
perm = insert_Perm_after(aenv, env->lv, env->cls, env->dom_front, sched_prev(insn->irn));
perm = insert_Perm_after(aenv, lv, env->cls, env->birg->dom_front, sched_prev(insn->irn));
/* Registers are propagated by insert_Perm_after(). Clean them here! */
if(perm) {
......@@ -445,7 +448,7 @@ static ir_node *pre_process_constraints(be_chordal_alloc_env_t *alloc_env, be_in
the Perm. Recomputing liveness is also a good idea if a Perm is inserted, since
the live sets may change.
*/
// be_liveness_recompute(env->lv);
// be_liveness_recompute(lv);
obstack_free(&env->obst, insn);
*the_insn = insn = chordal_scan_insn(env, insn->irn);
......@@ -476,6 +479,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i
be_insn_t *insn = chordal_scan_insn(env, irn);
ir_node *res = insn->next_insn;
int be_silent = *silent;
be_lv_t *lv = env->birg->lv;
if(insn->pre_colored) {
int i;
......@@ -570,7 +574,7 @@ static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env, ir_node *i
assert(is_Proj(proj));
if(values_interfere(env->lv, proj, irn) && !pmap_contains(partners, proj)) {
if(values_interfere(lv, proj, irn) && !pmap_contains(partners, proj)) {
assert(n_alloc < n_regs);
alloc_nodes[n_alloc] = proj;
pmap_insert(partners, proj, NULL);
......@@ -707,14 +711,15 @@ static void pressure(ir_node *block, void *env_ptr)
be_chordal_env_t *env = alloc_env->chordal_env;
bitset_t *live = alloc_env->live;
ir_node *irn;
be_lv_t *lv = env->birg->lv;
DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg;)
int i, n;
unsigned step = 0;
unsigned pressure = 0;
struct list_head *head;
pset *live_in = be_lv_pset_put_in(env->lv, block, pset_new_ptr_default());
pset *live_end = be_lv_pset_put_end(env->lv, block, pset_new_ptr_default());
pset *live_in = be_lv_pset_put_in(lv, block, pset_new_ptr_default());
pset *live_end = be_lv_pset_put_end(lv, block, pset_new_ptr_default());
DBG((dbg, LEVEL_1, "Computing pressure in block %+F\n", block));
bitset_clear_all(live);
......@@ -808,7 +813,8 @@ static void assign(ir_node *block, void *env_ptr)
bitset_t *in_colors = alloc_env->in_colors;
const arch_env_t *arch_env = env->birg->main_env->arch_env;
struct list_head *head = get_block_border_head(env, block);
pset *live_in = be_lv_pset_put_in(env->lv, block, pset_new_ptr_default());
be_lv_t *lv = env->birg->lv;
pset *live_in = be_lv_pset_put_in(lv, block, pset_new_ptr_default());
const ir_node *irn;
border_t *b;
......@@ -864,7 +870,7 @@ static void assign(ir_node *block, void *env_ptr)
* Assign a color, if it is a local def. Global defs already have a
* color.
*/
if(b->is_def && !be_is_live_in(env->lv, block, irn)) {
if(b->is_def && !be_is_live_in(lv, block, irn)) {
const arch_register_t *reg;
int col = NO_COLOR;
......@@ -912,11 +918,14 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
{
be_chordal_alloc_env_t env;
char buf[256];
be_irg_t *birg = chordal_env->birg;
int colors_n = arch_register_class_n_regs(chordal_env->cls);
ir_graph *irg = chordal_env->irg;
be_assure_dom_front(birg);
be_assure_liveness(birg);
assure_doms(irg);
env.chordal_env = chordal_env;
......
......@@ -372,72 +372,73 @@ static color_t *reg_to_color(const draw_chordal_env_t *env,
static void draw_block(ir_node *bl, void *data)
{
static const color_t black = { 0, 0, 0 };
static const color_t black = { 0, 0, 0 };
const draw_chordal_env_t *env = data;
pset *live_in = be_lv_pset_put_in(env->chordal_env->lv, bl, pset_new_ptr_default());
ir_node *irn;
border_t *b;
const draw_chordal_env_t *env = data;
pset *live_in = be_lv_pset_put_in(env->chordal_env->birg->lv, bl, pset_new_ptr_default());
be_lv_t *lv = env->chordal_env->birg->lv;
ir_node *irn;
border_t *b;
struct list_head *head = get_block_border_head(env->chordal_env, bl);
ir_node *dom = get_Block_idom(bl);
const draw_chordal_opts_t *opts = env->opts;
struct block_dims *dims = pmap_get(env->block_dims, bl);
char buf[64];
ir_node *dom = get_Block_idom(bl);
const draw_chordal_opts_t *opts = env->opts;
struct block_dims *dims = pmap_get(env->block_dims, bl);
char buf[64];
ir_snprintf(buf, sizeof(buf), "%F", bl);
ir_snprintf(buf, sizeof(buf), "%F", bl);
env->plotter->vtab->set_color(env->plotter, &black);
env->plotter->vtab->box(env->plotter, &dims->box);
env->plotter->vtab->set_color(env->plotter, &black);
env->plotter->vtab->box(env->plotter, &dims->box);
#if 0
env->plotter->vtab->text(env->plotter, dims->box.x, dims->box.y, buf);
#endif
list_for_each_entry(border_t, b, head, list) {
if(b->is_def) {
const arch_register_t *reg = arch_get_irn_register(env->arch_env, b->irn);
int col = arch_register_get_index(reg);
int live_out = be_is_live_out(env->chordal_env->lv, bl, b->irn);
int x = (col + 1) * opts->h_inter_gap;
int ystart = (b->step) * opts->v_inter_gap;
int ystop = (b->other_end->step)
* opts->v_inter_gap + (live_out ? 0 : opts->v_inter_gap / 2);
color_t color;
reg_to_color(env, bl, b->irn, &color);
x += dims->box.x;
ystart += dims->box.y;
ystop += dims->box.y;
env->plotter->vtab->set_color(env->plotter, &color);
env->plotter->vtab->line(env->plotter, x, ystart, x, ystop);
env->plotter->vtab->line(env->plotter, x - 2, ystart, x + 2, ystart);
env->plotter->vtab->line(env->plotter, x - 2, ystop, x + 2, ystop);
}
list_for_each_entry(border_t, b, head, list) {
if(b->is_def) {
const arch_register_t *reg = arch_get_irn_register(env->arch_env, b->irn);
int col = arch_register_get_index(reg);
int live_out = be_is_live_out(lv, bl, b->irn);
int x = (col + 1) * opts->h_inter_gap;
int ystart = (b->step) * opts->v_inter_gap;
int ystop = (b->other_end->step)
* opts->v_inter_gap + (live_out ? 0 : opts->v_inter_gap / 2);
color_t color;
reg_to_color(env, bl, b->irn, &color);
x += dims->box.x;
ystart += dims->box.y;
ystop += dims->box.y;
env->plotter->vtab->set_color(env->plotter, &color);
env->plotter->vtab->line(env->plotter, x, ystart, x, ystop);
env->plotter->vtab->line(env->plotter, x - 2, ystart, x + 2, ystart);
env->plotter->vtab->line(env->plotter, x - 2, ystop, x + 2, ystop);
}
}
if(dom) {
struct block_dims *dom_dims = pmap_get(env->block_dims, dom);
for(irn = pset_first(live_in); irn; irn = pset_next(live_in)) {
if(arch_irn_has_reg_class(env->arch_env, irn, -1, env->cls)) {
const arch_register_t *reg = arch_get_irn_register(env->arch_env, irn);
int col = arch_register_get_index(reg);
int x = (col + 1) * opts->h_inter_gap;
color_t color;
reg_to_color(env, bl, irn, &color);
env->plotter->vtab->set_color(env->plotter, &color);
env->plotter->vtab->line(env->plotter,
dims->box.x + x,
dims->box.y + dims->box.h,
dom_dims->box.x + x,
dom_dims->box.y);
}
}
struct block_dims *dom_dims = pmap_get(env->block_dims, dom);
for(irn = pset_first(live_in); irn; irn = pset_next(live_in)) {
if(arch_irn_has_reg_class(env->arch_env, irn, -1, env->cls)) {
const arch_register_t *reg = arch_get_irn_register(env->arch_env, irn);
int col = arch_register_get_index(reg);
int x = (col + 1) * opts->h_inter_gap;
color_t color;
reg_to_color(env, bl, irn, &color);
env->plotter->vtab->set_color(env->plotter, &color);
env->plotter->vtab->line(env->plotter,
dims->box.x + x,
dims->box.y + dims->box.h,
dom_dims->box.x + x,
dom_dims->box.y);
}
}
}
del_pset(live_in);
......@@ -452,6 +453,8 @@ static void draw(draw_chordal_env_t *env, const rect_t *start_box)
bbox.w = start_box->w + 2 * env->opts->x_margin;
bbox.h = start_box->h + 2 * env->opts->y_margin;
be_assure_liveness(env->chordal_env->birg);
p->vtab->begin(p, &bbox);
irg_block_walk_graph(env->chordal_env->irg, draw_block, NULL, env);
p->vtab->finish(p);
......
......@@ -83,6 +83,7 @@ void be_ra_chordal_check(be_chordal_env_t *chordal_env) {
pmap_entry *pme;
ir_node **nodes, *n1, *n2;
int i, o;
be_lv_t *lv = chordal_env->birg->lv;
DEBUG_ONLY(firm_dbg_module_t *dbg = chordal_env->dbg;)
/* Collect all irns */
......@@ -109,7 +110,7 @@ void be_ra_chordal_check(be_chordal_env_t *chordal_env) {
}
for (o = i+1, n2 = nodes[o]; n2; n2 = nodes[++o]) {
n2_reg = arch_get_irn_register(arch_env, n2);
if (values_interfere(chordal_env->lv, n1, n2) && n1_reg == n2_reg) {
if (values_interfere(lv, n1, n2) && n1_reg == n2_reg) {
DBG((dbg, 0, "Values %+F and %+F interfere and have the same register assigned: %s\n", n1, n2, n1_reg->name));
assert(0 && "Interfering values have the same color!");
}
......@@ -123,7 +124,7 @@ int nodes_interfere(const be_chordal_env_t *env, const ir_node *a, const ir_node
if(env->ifg)
return be_ifg_connected(env->ifg, a, b);
else
return values_interfere(env->lv, a, b);
return values_interfere(env->birg->lv, a, b);
}
......@@ -361,7 +362,7 @@ static void memory_operand_walker(ir_node *irn, void *env) {
if (get_nodes_block(src) == block && arch_possible_memory_operand(aenv, src, pos)) {
DBG((cenv->dbg, LEVEL_3, "performing memory operand %+F at %+F\n", irn, src));
arch_perform_memory_operand(aenv, src, spill, pos);
//arch_perform_memory_operand(aenv, src, spill, pos);
}
}
......@@ -538,14 +539,14 @@ static void be_init_timer(be_options_t *main_opts)
/**
* Performs chordal register allocation for each register class on given irg.
*
* @param bi Backend irg object
* @param birg Backend irg object
* @return Structure containing timer for the single phases or NULL if no timing requested.
*/
static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
static be_ra_timer_t *be_ra_chordal_main(be_irg_t *birg)
{
const be_main_env_t *main_env = bi->main_env;
const be_main_env_t *main_env = birg->main_env;
const arch_isa_t *isa = arch_env_get_isa(main_env->arch_env);
ir_graph *irg = bi->irg;
ir_graph *irg = birg->irg;
be_options_t *main_opts = main_env->options;
int splitted = 0;
......@@ -556,14 +557,12 @@ static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
BE_TIMER_PUSH(ra_timer.t_other);
BE_TIMER_PUSH(ra_timer.t_prolog);
compute_doms(irg);
be_assure_dom_front(birg);
be_assure_liveness(birg);
chordal_env.opts = &options;
chordal_env.irg = irg;
chordal_env.birg = bi;
chordal_env.dom_front = be_compute_dominance_frontiers(irg);
chordal_env.exec_freq = bi->execfreqs;
chordal_env.lv = be_liveness(irg);
chordal_env.birg = birg;
FIRM_DBG_REGISTER(chordal_env.dbg, "firm.be.chordal");
obstack_init(&chordal_env.obst);
......@@ -593,16 +592,18 @@ static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
/* put all ignore registers into the ignore register set. */
put_ignore_colors(&chordal_env);
#if 0
BE_TIMER_PUSH(ra_timer.t_live);
be_liveness_recompute(chordal_env.lv);
be_liveness_recompute(birg->lv);
BE_TIMER_POP(ra_timer.t_live);
dump(BE_CH_DUMP_LIVE, irg, chordal_env.cls, "-live", dump_ir_block_graph_sched);
#endif
be_pre_spill_prepare_constr(&chordal_env);
dump(BE_CH_DUMP_CONSTR, irg, chordal_env.cls, "-constr-pre", dump_ir_block_graph_sched);
if(be_stat_ev_is_active()) {
spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, chordal_env.exec_freq);
spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq);
}
BE_TIMER_PUSH(ra_timer.t_spill);
......@@ -628,7 +629,7 @@ static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
BE_TIMER_POP(ra_timer.t_spill);
if(be_stat_ev_is_active()) {
spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, chordal_env.exec_freq) - spillcosts;
spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - spillcosts;
be_stat_ev_l("spillcosts", (long) spillcosts);
node_stats(&chordal_env, &node_stat);
......@@ -644,7 +645,7 @@ static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
check_for_memory_operands(&chordal_env);
be_abi_fix_stack_nodes(bi->abi, chordal_env.lv);
be_abi_fix_stack_nodes(birg->abi, birg->lv);
BE_TIMER_PUSH(ra_timer.t_verify);
......@@ -789,8 +790,6 @@ static be_ra_timer_t *be_ra_chordal_main(const be_irg_t *bi)
dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched);
obstack_free(&chordal_env.obst, NULL);
be_free_dominance_frontiers(chordal_env.dom_front);
be_liveness_free(chordal_env.lv);
BE_TIMER_POP(ra_timer.t_epilog);
BE_TIMER_POP(ra_timer.t_other);
......
......@@ -57,12 +57,9 @@ typedef struct _border_t {
struct _be_chordal_env_t {
struct obstack obst; /**< An obstack for temporary storage. */
be_ra_chordal_opts_t *opts; /**< A pointer to the chordal ra options. */
const be_irg_t *birg; /**< Back-end IRG session. */
dom_front_info_t *dom_front; /**< Dominance frontiers. */
be_irg_t *birg; /**< Back-end IRG session. */
ir_graph *irg; /**< The graph under examination. */
const arch_register_class_t *cls; /**< The current register class. */
ir_exec_freq *exec_freq; /**< Adam's execution frequencies. */
be_lv_t *lv; /**< Liveness information. */
pmap *border_heads; /**< Maps blocks to border heads. */
be_ifg_t *ifg; /**< The interference graph. */
void *data; /**< Some pointer, to which different phases can attach data to. */
......
......@@ -267,7 +267,7 @@ int co_get_costs_exec_freq(const copy_opt_t *co, ir_node *root, ir_node* arg, in
int res;
ir_node *root_bl = get_nodes_block(root);
ir_node *copy_bl = is_Phi(root) ? get_Block_cfgpred_block(root_bl, pos) : root_bl;
res = get_block_execfreq_ulong(co->cenv->exec_freq, copy_bl);
res = get_block_execfreq_ulong(co->cenv->birg->exec_freq, copy_bl);
/* don't allow values smaller than one. */
return res < 1 ? 1 : res;
......@@ -1001,6 +1001,7 @@ static void appel_walker(ir_node *bl, void *data)
struct obstack *obst = &env->obst;
void *base = obstack_base(obst);
pset *live = pset_new_ptr_default();
be_lv_t *lv = env->co->cenv->birg->lv;
int n_insns = 0;
int n_nodes = 0;
......@@ -1034,7 +1035,7 @@ static void appel_walker(ir_node *bl, void *data)
}
DBG((env->co->cenv->dbg, LEVEL_2, "%+F\n", bl));
be_liveness_end_of_block(env->co->cenv->lv, env->co->aenv, env->co->cls, bl, live);
be_liveness_end_of_block(lv, env->co->aenv, env->co->cls, bl, live);
/* Generate the bad and ugly. */
for(i = n_insns - 1; i >= 0; --i) {
......@@ -1156,8 +1157,9 @@ void co_dump_appel_graph_cliques(const copy_opt_t *co, FILE *f)
int n_colors;
appel_clique_walker_t env;
bitset_t *adm = bitset_alloca(co->cls->n_regs);
be_lv_t *lv = co->cenv->birg->lv;
be_liveness_recompute(co->cenv->lv);
be_liveness_recompute(lv);
obstack_init(&env.obst);
phase_init(&env.ph, "appel_clique_dumper", co->irg, PHASE_DEFAULT_GROWTH, appel_clique_walker_irn_init);
env.curr_nr = co->cls->n_regs;
......
......@@ -42,7 +42,8 @@ static void ifg_std_free(void *self)
static int ifg_std_connected(const void *self, const ir_node *a, const ir_node *b)
{
const ifg_std_t *ifg = self;
return values_interfere(ifg->env->lv, a, b);
be_lv_t *lv = ifg->env->birg->lv;
return values_interfere(lv, a, b);
}
typedef struct _nodes_iter_t {
......@@ -134,7 +135,7 @@ static void find_neighbour_walker(ir_node *block, void *data)
border_t *b;
int has_started = 0;
if(!be_is_live_in(it->env->lv, block, it->irn) && block != get_nodes_block(it->irn))
if(!be_is_live_in(it->env->birg->lv, block, it->irn) && block != get_nodes_block(it->irn))
return;
foreach_border_head(head, b) {
......
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "irgraph_t.h"
#include "irmode_t.h"
......
......@@ -57,7 +57,7 @@
*/
struct _dom_front_info_t {
struct _be_dom_front_info_t {
pmap *df_map;
};
......@@ -111,9 +111,9 @@ static void compute_df(ir_node *n, pmap *df_map)
}
dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg)
be_dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg)
{
dom_front_info_t *info = xmalloc(sizeof(*info));
be_dom_front_info_t *info = xmalloc(sizeof(*info));
edges_assure(irg);
info->df_map = pmap_create();
......@@ -123,7 +123,7 @@ dom_front_info_t *be_compute_dominance_frontiers(ir_graph *irg)
return info;
}
void be_free_dominance_frontiers(dom_front_info_t *info)
void be_free_dominance_frontiers(be_dom_front_info_t *info)
{
pmap_entry *ent;
......@@ -134,12 +134,12 @@ void be_free_dominance_frontiers(dom_front_info_t *info)
free(info);
}
pset *be_get_dominance_frontier(dom_front_info_t *info, ir_node *block)
pset *be_get_dominance_frontier(be_dom_front_info_t *info, ir_node *block)
{
return pmap_get(info->df_map, block);
}
static void determine_phi_blocks(pset *copies, pset *copy_blocks, pset *phi_blocks, dom_front_info_t *df_info)
static void determine_phi_blocks(pset *copies, pset *copy_blocks, pset *phi_blocks, be_dom_front_info_t *df_info)
{
ir_node *bl;