- change various be_get_birg_XXX functions to be_get_irg_XXX functions.
authorMatthias Braun <matze@braunis.de>
Fri, 2 Jul 2010 16:58:16 +0000 (16:58 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 2 Jul 2010 16:58:16 +0000 (16:58 +0000)
[r27690]

37 files changed:
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/amd64/bearch_amd64.c
ir/be/beabi.c
ir/be/beblocksched.c
ir/be/bechordal.c
ir/be/bechordal_draw.c
ir/be/bechordal_main.c
ir/be/becopyopt.c
ir/be/beilpsched.c
ir/be/beintlive_t.h
ir/be/beirg.c
ir/be/beirg.h
ir/be/beloopana.c
ir/be/belower.c
ir/be/bemain.c
ir/be/bepbqpcoloring.c
ir/be/bepeephole.c
ir/be/beprefalloc.c
ir/be/besched.c
ir/be/beschedrss.c
ir/be/beschedtrace.c
ir/be/bespill.c
ir/be/bespillbelady.c
ir/be/bespillbelady2.c
ir/be/bespilldaemel.c
ir/be/bespillslots.c
ir/be/bespillutil.c
ir/be/bessaconstr.c
ir/be/bessadestr.c
ir/be/bestat.c
ir/be/bestate.c
ir/be/betranshlp.c
ir/be/beverify.c
ir/be/ia32/ia32_address_mode.c
ir/be/ia32/ia32_fpu.c
ir/be/ia32/ia32_x87.c
ir/be/mips/bearch_mips.c

index 7dbf1a3..2b83b8d 100644 (file)
@@ -178,7 +178,7 @@ static const arch_code_generator_if_t TEMPLATE_code_gen_if = {
  */
 static void *TEMPLATE_cg_init(be_irg_t *birg)
 {
-       const arch_env_t    *arch_env = be_get_birg_arch_env(birg);
+       const arch_env_t    *arch_env = be_get_irg_arch_env(birg->irg);
        TEMPLATE_isa_t      *isa      = (TEMPLATE_isa_t *) arch_env;
        TEMPLATE_code_gen_t *cg       = XMALLOC(TEMPLATE_code_gen_t);
 
index 50a725c..75bb246 100644 (file)
@@ -275,7 +275,7 @@ static const arch_code_generator_if_t amd64_code_gen_if = {
  */
 static void *amd64_cg_init(be_irg_t *birg)
 {
-       const arch_env_t    *arch_env = be_get_birg_arch_env(birg);
+       const arch_env_t *arch_env = be_get_irg_arch_env(birg->irg);
        amd64_isa_t      *isa      = (amd64_isa_t *) arch_env;
        amd64_code_gen_t *cg       = XMALLOC(amd64_code_gen_t);
 
index 8be3fb2..229062b 100644 (file)
@@ -2428,7 +2428,8 @@ void be_abi_fix_stack_nodes(be_abi_irg_t *env)
        int i, len;
        ir_node **phis;
        be_irg_t *birg = env->birg;
-       be_lv_t *lv = be_get_birg_liveness(birg);
+       ir_graph *irg  = env->irg;
+       be_lv_t  *lv   = be_get_irg_liveness(irg);
        fix_stack_walker_env_t walker_env;
 
        walker_env.sp_nodes = NEW_ARR_F(ir_node*, 0);
index f8c19c1..6c8bc8c 100644 (file)
@@ -747,8 +747,7 @@ void be_init_blocksched(void)
 
 ir_node **be_create_block_schedule(ir_graph *irg)
 {
-       const be_irg_t *birg      = be_birg_from_irg(irg);
-       ir_exec_freq   *execfreqs = be_get_birg_exec_freq(birg);
+       ir_exec_freq *execfreqs = be_get_irg_exec_freq(irg);
 
        switch (algo) {
        case BLOCKSCHED_GREEDY:
index 62eb27b..889884c 100644 (file)
@@ -538,13 +538,12 @@ void be_ra_chordal_color(be_chordal_env_t *chordal_env)
        be_chordal_alloc_env_t env;
        char buf[256];
        be_lv_t *lv;
-       be_irg_t *birg = chordal_env->birg;
        const arch_register_class_t *cls = chordal_env->cls;
 
        int colors_n          = arch_register_class_n_regs(cls);
        ir_graph *irg         = chordal_env->irg;
 
-       lv = be_assure_liveness(birg);
+       lv = be_assure_liveness(irg);
        be_liveness_assure_sets(lv);
        be_liveness_assure_chk(lv);
 
index d9ae4c3..c93410e 100644 (file)
@@ -378,7 +378,7 @@ static void draw_block(ir_node *bl, void *data)
 {
        static const color_t      black    = { 0, 0, 0 };
        const draw_chordal_env_t  *env     = data;
-       const be_lv_t             *lv      = be_get_birg_liveness(env->chordal_env->birg);
+       const be_lv_t             *lv      = be_get_irg_liveness(env->chordal_env->irg);
        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;
@@ -454,7 +454,7 @@ 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;
 
-       lv = be_assure_liveness(env->chordal_env->birg);
+       lv = be_assure_liveness(env->chordal_env->irg);
        be_liveness_assure_sets(lv);
        be_liveness_assure_chk(lv);
 
index 4d4a8da..94f2b94 100644 (file)
@@ -244,17 +244,17 @@ static be_node_stats_t last_node_stats;
  */
 static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls)
 {
-       be_chordal_env_t    *chordal_env = &pse->cenv;
-       be_irg_t            *birg        = pse->birg;
-       ir_graph            *irg         = be_get_birg_irg(birg);
+       be_chordal_env_t *chordal_env = &pse->cenv;
+       be_irg_t         *birg        = pse->birg;
+       ir_graph         *irg         = be_get_birg_irg(birg);
 
        pse->cls                   = cls;
        chordal_env->cls           = cls;
        chordal_env->border_heads  = pmap_create();
        chordal_env->ignore_colors = bitset_malloc(chordal_env->cls->n_regs);
 
-       be_assure_liveness(birg);
-       be_liveness_assure_chk(be_get_birg_liveness(birg));
+       be_assure_liveness(irg);
+       be_liveness_assure_chk(be_get_irg_liveness(irg));
 
        stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, birg->exec_freq));
 
@@ -401,7 +401,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
 
        be_timer_push(T_RA_PROLOG);
 
-       be_assure_liveness(birg);
+       be_assure_liveness(irg);
 
        chordal_env.obst          = &obst;
        chordal_env.opts          = &options;
@@ -499,7 +499,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
        dump(BE_CH_DUMP_LOWER, irg, NULL, "belower-after-ra");
 
        obstack_free(&obst, NULL);
-       be_liveness_invalidate(be_get_birg_liveness(birg));
+       be_liveness_invalidate(be_get_irg_liveness(irg));
        be_timer_pop(T_RA_EPILOG);
 
        be_timer_pop(T_RA_OTHER);
index b7afd30..b92b32d 100644 (file)
@@ -1159,7 +1159,7 @@ void co_driver(be_chordal_env_t *cenv)
        if (selected_copyopt->copyopt == void_algo)
                return;
 
-       be_liveness_assure_chk(be_get_birg_liveness(cenv->birg));
+       be_liveness_assure_chk(be_get_irg_liveness(cenv->irg));
 
        co = new_copy_opt(cenv, cost_func);
        co_build_ou_structure(co);
index 042dcef..4888211 100644 (file)
@@ -2004,7 +2004,7 @@ void be_ilp_sched(const be_irg_t *birg, be_options_t *be_opts)
 {
        be_ilpsched_env_t          env;
        ir_graph                   *irg      = be_get_birg_irg(birg);
-       const arch_env_t           *arch_env = be_get_birg_arch_env(birg);
+       const arch_env_t           *arch_env = be_get_irg_arch_env(irg);
        const ilp_sched_selector_t *sel      = arch_env->impl->get_ilp_sched_selector(arch_env);
 
        FIRM_DBG_REGISTER(env.dbg, "firm.be.sched.ilp");
index e694d01..a12889a 100644 (file)
@@ -211,7 +211,7 @@ static inline int _strictly_dominates_use(const ir_node *irn, const ir_edge_t *e
  */
 static inline int _be_lv_chk_before_irn(const be_irg_t *birg, const ir_node *irn, const ir_node *where)
 {
-       const be_lv_t *lv = be_get_birg_liveness(birg);
+       const be_lv_t *lv = be_get_irg_liveness(birg->irg);
        const ir_edge_t *edge;
 
        /* the node must strictly dominate the location, else it cannot be live there. */
@@ -246,7 +246,7 @@ static inline int _be_lv_chk_before_irn(const be_irg_t *birg, const ir_node *irn
  */
 static inline int _be_lv_chk_after_irn(const be_irg_t *birg, const ir_node *irn, const ir_node *where)
 {
-       const be_lv_t *lv = be_get_birg_liveness(birg);
+       const be_lv_t *lv = be_get_irg_liveness(birg->irg);
        const ir_edge_t *edge;
 
        if (!_value_dominates(irn, where))
index 262dadc..11d402c 100644 (file)
 #include "belive.h"
 #include "bedomfront.h"
 
-be_lv_t *be_assure_liveness(be_irg_t *birg)
+be_lv_t *be_assure_liveness(ir_graph *irg)
 {
+       be_irg_t *birg = be_birg_from_irg(irg);
        if (birg->lv != NULL)
                return birg->lv;
 
        return birg->lv = be_liveness(birg->irg);
 }
 
-void be_assure_dom_front(be_irg_t *birg)
+void be_assure_dom_front(ir_graph *irg)
 {
+       be_irg_t *birg = be_birg_from_irg(irg);
        if (birg->dom_front != NULL)
                return;
 
        birg->dom_front = be_compute_dominance_frontiers(birg->irg);
 }
 
-void be_invalidate_dom_front(be_irg_t *birg)
+void be_invalidate_dom_front(ir_graph *irg)
 {
+       be_irg_t *birg = be_birg_from_irg(irg);
        if (birg->dom_front == NULL)
                return;
 
@@ -57,8 +60,9 @@ void be_invalidate_dom_front(be_irg_t *birg)
        birg->dom_front = NULL;
 }
 
-void be_free_birg(be_irg_t *birg)
+void be_free_birg(ir_graph *irg)
 {
+       be_irg_t *birg = be_birg_from_irg(irg);
        free_execfreq(birg->exec_freq);
        birg->exec_freq = NULL;
 
@@ -72,5 +76,5 @@ void be_free_birg(be_irg_t *birg)
        }
 
        obstack_free(&birg->obst, NULL);
-       birg->irg->be_data = NULL;
+       irg->be_data = NULL;
 }
index 2f16db5..aa65327 100644 (file)
 #include "be_t.h"
 #include "irtypes.h"
 
-be_lv_t *be_assure_liveness(be_irg_t *birg);
+be_lv_t *be_assure_liveness(ir_graph *irg);
 
-void be_assure_dom_front(be_irg_t *birg);
-void be_invalidate_dom_front(be_irg_t *birg);
+void be_assure_dom_front(ir_graph *irg);
+void be_invalidate_dom_front(ir_graph *irg);
 
 /**
  * frees all memory allocated by birg structures (liveness, dom_front, ...).
  * The memory of the birg structure itself is not freed.
  */
-void be_free_birg(be_irg_t *birg);
+void be_free_birg(ir_graph *irg);
 
 /**
  * An ir_graph with additional analysis data about this irg. Also includes some
@@ -61,34 +61,35 @@ struct be_irg_t {
                                           during code selection) */
 };
 
-static inline be_lv_t *be_get_birg_liveness(const be_irg_t *birg)
+static inline be_irg_t *be_birg_from_irg(const ir_graph *irg)
 {
-       return birg->lv;
+       return (be_irg_t*) irg->be_data;
 }
 
-static inline ir_exec_freq *be_get_birg_exec_freq(const be_irg_t *birg)
+static inline be_lv_t *be_get_irg_liveness(const ir_graph *irg)
 {
-       return birg->exec_freq;
+       return be_birg_from_irg(irg)->lv;
 }
 
-static inline be_dom_front_info_t *be_get_birg_dom_front(const be_irg_t *birg)
+static inline ir_exec_freq *be_get_irg_exec_freq(const ir_graph *irg)
 {
-       return birg->dom_front;
+       return be_birg_from_irg(irg)->exec_freq;
 }
 
-static inline ir_graph *be_get_birg_irg(const be_irg_t *birg)
+static inline be_dom_front_info_t *be_get_irg_dom_front(const ir_graph *irg)
 {
-       return birg->irg;
+       return be_birg_from_irg(irg)->dom_front;
 }
 
-static inline const arch_env_t *be_get_birg_arch_env(const be_irg_t *birg)
+/** deprecated */
+static inline ir_graph *be_get_birg_irg(const be_irg_t *birg)
 {
-       return birg->main_env->arch_env;
+       return birg->irg;
 }
 
-static inline be_irg_t *be_birg_from_irg(const ir_graph *irg)
+static inline const arch_env_t *be_get_irg_arch_env(const ir_graph *irg)
 {
-       return (be_irg_t*) irg->be_data;
+       return be_birg_from_irg(irg)->main_env->arch_env;
 }
 
 static inline struct obstack *be_get_birg_obst(const ir_graph *irg)
index a5e7be2..6b7ee74 100644 (file)
@@ -74,7 +74,7 @@ static int cmp_loop_info(const void *a, const void *b, size_t size)
 static unsigned be_compute_block_pressure(const be_irg_t *birg,
                ir_node *block, const arch_register_class_t *cls)
 {
-       be_lv_t      *lv = be_get_birg_liveness(birg);
+       be_lv_t      *lv = be_get_irg_liveness(birg->irg);
        ir_nodeset_t  live_nodes;
        ir_node      *irn;
        int          max_live;
@@ -186,7 +186,7 @@ be_loopana_t *be_new_loop_pressure(be_irg_t *birg,
        ir_graph         *irg      = be_get_birg_irg(birg);
        be_loopana_t     *loop_ana = XMALLOC(be_loopana_t);
        ir_loop          *irg_loop = get_irg_loop(irg);
-       const arch_env_t *arch_env = be_get_birg_arch_env(birg);
+       const arch_env_t *arch_env = be_get_irg_arch_env(irg);
        int               i;
 
        loop_ana->data = new_set(cmp_loop_info, 16);
index 9cd3aa3..2941eb4 100644 (file)
@@ -839,7 +839,7 @@ void assure_constraints(be_irg_t *birg)
 
        ir_nodemap_destroy(&cenv.op_set);
        obstack_free(&cenv.obst, NULL);
-       be_liveness_invalidate(be_get_birg_liveness(birg));
+       be_liveness_invalidate(be_get_irg_liveness(irg));
 }
 
 
@@ -1032,8 +1032,8 @@ void lower_nodes_after_ra(be_irg_t *birg, int do_copy)
        env.do_copy = do_copy;
 
        /* we will need interference */
-       be_liveness_assure_chk(be_get_birg_liveness(birg));
-
        irg = be_get_birg_irg(birg);
+       be_liveness_assure_chk(be_get_irg_liveness(irg));
+
        irg_walk_graph(irg, NULL, lower_nodes_after_ra_walker, &env);
 }
index 5ea6111..9677128 100644 (file)
@@ -842,7 +842,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                        }
                }
 
-               be_free_birg(birg);
+               be_free_birg(irg);
                stat_ev_ctx_pop("bemain_irg");
        }
        ir_profile_free();
index 75b09c8..b8ff004 100644 (file)
@@ -521,7 +521,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env)
 
        printf("#### ----- === Allocating registers of %s (%s) ===\n", cls->name, get_entity_name(get_irg_entity(irg)));
 #endif
-       lv = be_assure_liveness(birg);
+       lv = be_assure_liveness(irg);
        be_liveness_assure_sets(lv);
        be_liveness_assure_chk(lv);
 
index 5d3065b..7419303 100644 (file)
@@ -411,9 +411,9 @@ ir_node *be_peephole_IncSP_IncSP(ir_node *node)
 
 void be_peephole_opt(be_irg_t *birg)
 {
-       ir_graph   *irg = be_get_birg_irg(birg);
-       unsigned n_classes;
-       unsigned i;
+       ir_graph *irg = be_get_birg_irg(birg);
+       unsigned  n_classes;
+       unsigned  i;
 
        /* barrier nodes are used for register allocations. They hinders
         * peephole optimizations, so remove them here. */
@@ -422,10 +422,10 @@ void be_peephole_opt(be_irg_t *birg)
        /* we sometimes find BadE nodes in float apps like optest_float.c or
         * kahansum.c for example... */
        be_liveness_invalidate(birg->lv);
-       be_liveness_assure_sets(be_assure_liveness(birg));
+       be_liveness_assure_sets(be_assure_liveness(irg));
 
-       arch_env = be_get_birg_arch_env(birg);
-       lv       = be_get_birg_liveness(birg);
+       arch_env = be_get_irg_arch_env(irg);
+       lv       = be_get_irg_liveness(irg);
 
        n_classes = arch_env_get_n_reg_class(arch_env);
        register_values = XMALLOCN(ir_node**, n_classes);
index 223081d..5609f8e 100644 (file)
@@ -1900,7 +1900,7 @@ static void be_pref_alloc_cls(void)
 {
        int i;
 
-       lv = be_assure_liveness(birg);
+       lv = be_assure_liveness(irg);
        be_liveness_assure_sets(lv);
 
        ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
index 4f82e46..ef64e39 100644 (file)
@@ -162,7 +162,7 @@ void be_remove_dead_nodes_from_schedule(be_irg_t *birg)
 
        remove_dead_nodes_env_t env;
        env.reachable = bitset_alloca(get_irg_last_idx(irg));
-       env.lv  = be_get_birg_liveness(birg);
+       env.lv  = be_get_irg_liveness(irg);
        env.irg = irg;
 
        // mark all reachable nodes
index 67bc76e..06954ae 100644 (file)
@@ -2200,7 +2200,7 @@ void rss_schedule_preparation(be_irg_t *birg)
        init_rss_special_nodes(irg);
 
        rss.irg      = irg;
-       rss.arch_env = be_get_birg_arch_env(birg);
+       rss.arch_env = be_get_irg_arch_env(irg);
        rss.abi      = birg->abi;
        rss.h        = heights_new(irg);
        rss.nodes    = plist_new();
index 7362abb..f513734 100644 (file)
@@ -632,7 +632,7 @@ static void *muchnik_init_graph(const list_sched_selector_t *vtab, const be_irg_
 {
        trace_env_t *env  = trace_init(birg);
        env->selector     = vtab;
-       env->selector_env = (void*) be_get_birg_arch_env(birg);
+       env->selector_env = (void*) be_get_irg_arch_env(birg->irg);
        return (void *)env;
 }
 
index 1e18a65..0bbb445 100644 (file)
@@ -248,7 +248,7 @@ void be_pre_spill_prepare_constr(be_irg_t *birg,
        env.birg = birg;
        env.cls  = cls;
 
-       be_assure_liveness(birg);
+       be_assure_liveness(irg);
 
        irg_block_walk_graph(irg, pre_spill_prepare_constr_walker, NULL, &env);
 }
index 9fcba3c..32fccbe 100644 (file)
@@ -932,7 +932,7 @@ static void be_spill_belady(be_irg_t *birg, const arch_register_class_t *rcls)
        int i;
        ir_graph *irg = be_get_birg_irg(birg);
 
-       be_liveness_assure_sets(be_assure_liveness(birg));
+       be_liveness_assure_sets(be_assure_liveness(irg));
 
        stat_ev_tim_push();
        /* construct control flow loop tree */
@@ -951,7 +951,7 @@ static void be_spill_belady(be_irg_t *birg, const arch_register_class_t *rcls)
        stat_ev_tim_push();
        obstack_init(&obst);
        cls       = rcls;
-       lv        = be_get_birg_liveness(birg);
+       lv        = be_get_irg_liveness(irg);
        n_regs    = cls->n_regs - be_put_ignore_regs(birg, cls, NULL);
        ws        = new_workset();
        uses      = be_begin_uses(irg, lv);
index 4b2386f..bbc1de2 100644 (file)
@@ -1487,14 +1487,14 @@ static void be_spill_belady(be_irg_t *birg, const arch_register_class_t *cls)
        /* init belady env */
        obstack_init(&env.ob);
        env.irg        = irg;
-       env.arch       = be_get_birg_arch_env(birg);
+       env.arch       = be_get_irg_arch_env(irg);
        env.cls        = cls;
-       env.lv         = be_get_birg_liveness(birg);
+       env.lv         = be_get_irg_liveness(irg);
        env.dfs        = env.lv->dfs;
        env.n_regs     = n_regs;
        env.ws         = new_workset(&env, &env.ob);
        env.senv       = be_new_spill_env(birg);
-       env.ef         = be_get_birg_exec_freq(birg);
+       env.ef         = be_get_irg_exec_freq(irg);
        env.spilled    = bitset_irg_obstack_alloc(&env.ob, irg);
        env.extra_spilled = ir_nodeset_new(64);
        env.n_blocks   = 0;
index dbd9533..e364601 100644 (file)
@@ -379,17 +379,17 @@ static void spill_block(ir_node *block, void *data)
 
 static void be_spill_daemel(be_irg_t *birg, const arch_register_class_t *new_cls)
 {
-       ir_graph     *irg    = be_get_birg_irg(birg);
+       ir_graph *irg = be_get_birg_irg(birg);
        n_regs = new_cls->n_regs - be_put_ignore_regs(birg, new_cls, NULL);
 
        if (n_regs == 0)
                return;
 
-       be_liveness_assure_sets(be_assure_liveness(birg));
+       be_liveness_assure_sets(be_assure_liveness(irg));
 
        spill_env     = be_new_spill_env(birg);
        cls           = new_cls;
-       lv            = be_get_birg_liveness(birg);
+       lv            = be_get_irg_liveness(irg);
        spilled_nodes = bitset_malloc(get_irg_last_idx(irg));
 
        DBG((dbg, LEVEL_1, "*** RegClass %s\n", cls->name));
index 6fa43ca..543d37d 100644 (file)
@@ -150,7 +150,7 @@ static spill_t *collect_memphi(be_fec_env_t *env, ir_node *node,
        int i, arity;
        spill_t spill, *res;
        int hash = hash_irn(node);
-       const ir_exec_freq *exec_freq = be_get_birg_exec_freq(env->birg);
+       const ir_exec_freq *exec_freq = be_get_irg_exec_freq(env->birg->irg);
 
        assert(is_Phi(node));
 
@@ -244,7 +244,7 @@ static int merge_interferences(be_fec_env_t *env, bitset_t** interferences,
 static int my_values_interfere2(be_irg_t *birg, const ir_node *a,
                                 const ir_node *b)
 {
-       be_lv_t *lv = be_get_birg_liveness(birg);
+       be_lv_t *lv = be_get_irg_liveness(birg->irg);
 
     int a2b = _value_dominates(a, b);
     int b2a = _value_dominates(b, a);
@@ -766,7 +766,7 @@ be_fec_env_t *be_new_frame_entity_coalescer(be_irg_t *birg)
        const arch_env_t *arch_env = birg->main_env->arch_env;
        be_fec_env_t     *env      = XMALLOC(be_fec_env_t);
 
-       be_liveness_assure_chk(be_assure_liveness(birg));
+       be_liveness_assure_chk(be_assure_liveness(birg->irg));
 
        obstack_init(&env->obst);
        env->arch_env       = arch_env;
index fd5c477..86eef3e 100644 (file)
@@ -151,16 +151,17 @@ static spill_info_t *get_spillinfo(const spill_env_t *env, ir_node *value)
 spill_env_t *be_new_spill_env(be_irg_t *birg)
 {
        const arch_env_t *arch_env = birg->main_env->arch_env;
+       ir_graph         *irg      = be_get_birg_irg(birg);
 
        spill_env_t *env = XMALLOC(spill_env_t);
        env->spills                     = new_set(cmp_spillinfo, 1024);
-       env->irg            = be_get_birg_irg(birg);
+       env->irg            = irg;
        env->birg           = birg;
        env->arch_env       = arch_env;
        ir_nodeset_init(&env->mem_phis);
        env->spill_cost     = arch_env->spill_cost;
        env->reload_cost    = arch_env->reload_cost;
-       env->exec_freq      = be_get_birg_exec_freq(birg);
+       env->exec_freq      = be_get_irg_exec_freq(irg);
        obstack_init(&env->obst);
 
 #ifdef FIRM_STATISTICS
@@ -991,7 +992,7 @@ void be_insert_spills_reloads(spill_env_t *env)
                 * SSA form for the spilled value */
                if (ARR_LEN(copies) > 0) {
                        be_ssa_construction_env_t senv;
-                       /* be_lv_t *lv = be_get_birg_liveness(env->birg); */
+                       /* be_lv_t *lv = be_get_irg_liveness(env->irg); */
 
                        be_ssa_construction_init(&senv, env->birg);
                        be_ssa_construction_add_copy(&senv, to_spill);
index 07d56ca..6cae3f2 100644 (file)
@@ -254,10 +254,10 @@ void be_ssa_construction_init(be_ssa_construction_env_t *env, be_irg_t *birg)
        stat_ev_dbl("bessaconstr_n_blocks", n_blocks);
 
        memset(env, 0, sizeof(env[0]));
-       be_assure_dom_front(birg);
+       be_assure_dom_front(irg);
 
        env->irg       = irg;
-       env->domfronts = be_get_birg_dom_front(birg);
+       env->domfronts = be_get_irg_dom_front(irg);
        env->new_phis  = NEW_ARR_F(ir_node*, 0);
        env->worklist  = new_waitq();
 
index 2586a7e..1617685 100644 (file)
@@ -386,9 +386,9 @@ static void set_regs_or_place_dupls_walker(ir_node *bl, void *data)
 void be_ssa_destruction(be_chordal_env_t *chordal_env)
 {
        insert_all_perms_env_t insert_perms_env;
-       pmap *perm_map = pmap_create();
-       ir_graph *irg  = chordal_env->irg;
-       be_lv_t *lv    = be_assure_liveness(chordal_env->birg);
+       pmap     *perm_map = pmap_create();
+       ir_graph *irg      = chordal_env->irg;
+       be_lv_t  *lv       = be_assure_liveness(irg);
 
        FIRM_DBG_REGISTER(dbg, "ir.be.ssadestr");
 
index a065a71..b9e4ec3 100644 (file)
@@ -110,8 +110,8 @@ void be_do_stat_reg_pressure(be_irg_t *birg, const arch_register_class_t *cls)
        env.insn_count   = 0;
        env.max_pressure = 0;
        env.regpressure  = 0;
-       be_liveness_assure_sets(be_assure_liveness(birg));
-       env.lv           = be_get_birg_liveness(birg);
+       be_liveness_assure_sets(be_assure_liveness(irg));
+       env.lv           = be_get_irg_liveness(irg);
        env.cls          = cls;
 
        /* Collect register pressure information for each block */
index c83bc6c..1b2c72f 100644 (file)
@@ -523,7 +523,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
        minibelady_env_t env;
        ir_graph *irg = be_get_birg_irg(birg);
        spill_info_t *info;
-       be_lv_t *lv = be_assure_liveness(birg);
+       be_lv_t *lv = be_assure_liveness(irg);
 
        be_liveness_assure_sets(lv);
        /* construct control flow loop tree */
@@ -536,7 +536,7 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
        env.func_env      = func_env;
        env.create_spill  = create_spill;
        env.create_reload = create_reload;
-       env.lv            = be_get_birg_liveness(birg);
+       env.lv            = be_get_irg_liveness(irg);
        env.uses          = be_begin_uses(irg, env.lv);
        env.spills        = NULL;
        ir_nodemap_init(&env.spill_infos);
index b79d3fa..d3b8abb 100644 (file)
@@ -442,10 +442,10 @@ void be_transform_graph(ir_graph *irg, arch_pretrans_nodes *func)
        free_loop_information(irg);
        set_irg_doms_inconsistent(irg);
 
-       be_liveness_invalidate(be_get_birg_liveness(birg));
+       be_liveness_invalidate(be_get_irg_liveness(irg));
        /* Hack for now, something is buggy with invalidate liveness... */
        birg->lv = NULL;
-       be_invalidate_dom_front(birg);
+       be_invalidate_dom_front(irg);
 
        /* recalculate edges */
        edges_deactivate(irg);
index a175c9b..db35228 100644 (file)
@@ -892,8 +892,8 @@ static void verify_block_register_allocation(ir_node *block, void *data)
 
 int be_verify_register_allocation(const be_irg_t *birg)
 {
-       arch_env      = be_get_birg_arch_env(birg);
        irg           = be_get_birg_irg(birg);
+       arch_env      = be_get_irg_arch_env(irg);
        lv            = be_liveness(irg);
        problem_found = 0;
 
index 009da9a..c7d6b8c 100644 (file)
@@ -527,7 +527,7 @@ static void mark_non_address_nodes(ir_node *node, void *env)
 void ia32_calculate_non_address_mode_nodes(be_irg_t *birg)
 {
        ir_graph *irg = be_get_birg_irg(birg);
-       be_lv_t  *lv  = be_assure_liveness(birg);
+       be_lv_t  *lv  = be_assure_liveness(irg);
 
        non_address_mode_nodes = bitset_malloc(get_irg_last_idx(irg));
 
index c77ad6a..f03b2a4 100644 (file)
@@ -245,7 +245,7 @@ static void rewire_fpu_mode_nodes(be_irg_t *birg)
        ir_graph *irg = be_get_birg_irg(birg);
        ir_node *initial_value;
        ir_node **phis;
-       be_lv_t *lv = be_get_birg_liveness(birg);
+       be_lv_t *lv = be_get_irg_liveness(irg);
        int i, len;
 
        /* do ssa construction for the fpu modes */
@@ -289,7 +289,7 @@ static void rewire_fpu_mode_nodes(be_irg_t *birg)
        be_ssa_construction_destroy(&senv);
        DEL_ARR_F(env.state_nodes);
 
-       be_liveness_invalidate(be_get_birg_liveness(birg));
+       be_liveness_invalidate(be_get_irg_liveness(irg));
 }
 
 void ia32_setup_fpu_mode(ia32_code_gen_t *cg)
index 7429188..d8b8b97 100644 (file)
@@ -2290,8 +2290,8 @@ void x87_simulate_graph(be_irg_t *birg)
        sim.worklist = new_waitq();
        waitq_put(sim.worklist, start_block);
 
-       be_assure_liveness(birg);
-       sim.lv = be_get_birg_liveness(birg);
+       be_assure_liveness(irg);
+       sim.lv = be_get_irg_liveness(irg);
        be_liveness_assure_sets(sim.lv);
 
        /* Calculate the liveness for all nodes. We must precalculate this info,
index 61adafa..6620a36 100644 (file)
@@ -275,7 +275,7 @@ static const arch_code_generator_if_t mips_code_gen_if = {
  */
 static void *mips_cg_init(be_irg_t *birg)
 {
-       const arch_env_t *arch_env = be_get_birg_arch_env(birg);
+       const arch_env_t *arch_env = be_get_irg_arch_env(birg->irg);
        mips_isa_t       *isa      = (mips_isa_t *) arch_env;
        mips_code_gen_t  *cg       = XMALLOCZ(mips_code_gen_t);