- const be_main_env_t *main_env = bi->main_env;
- const arch_isa_t *isa = arch_env_get_isa(main_env->arch_env);
- ir_graph *irg = bi->irg;
- be_options_t *main_opts = main_env->options;
- int splitted = 0;
- FILE *stat_file = NULL;
-
- char time_str[32];
- char irg_name[128];
- int j, m, line;
- be_chordal_env_t chordal_env;
- const char *stat_tags[STAT_TAG_LAST];
-
- /* if we want to do some statistics, push the environment. */
- if(strlen(stat_file_name) > 0 && (stat_file = fopen(stat_file_name, "at")) != NULL) {
-
- /* initialize the statistics tags */
- ir_snprintf(time_str, sizeof(time_str),"%u", time(NULL));
- ir_snprintf(irg_name, sizeof(irg_name), "%F", irg);
-
- stat_tags[STAT_TAG_FILE] = be_retrieve_dbg_info(get_entity_dbg_info(get_irg_entity(irg)), &line);
- stat_tags[STAT_TAG_TIME] = time_str;
- stat_tags[STAT_TAG_IRG] = irg_name;
- stat_tags[STAT_TAG_CLS] = "<all>";
-
- be_stat_ev_push(stat_tags, STAT_TAG_LAST, stat_file);
- }
-
- BE_TIMER_INIT(main_opts);
- BE_TIMER_PUSH(ra_timer.t_other);
- BE_TIMER_PUSH(ra_timer.t_prolog);
-
- compute_doms(irg);
-
- 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;
- /*compute_execfreq(irg, be_loop_weight);*/
- chordal_env.lv = be_liveness(irg);
- FIRM_DBG_REGISTER(chordal_env.dbg, "firm.be.chordal");
-
- obstack_init(&chordal_env.obst);
-
- BE_TIMER_POP(ra_timer.t_prolog);
-
- be_stat_ev("insns_before", count_insns(irg));
-
- /* Perform the following for each register class. */
- for (j = 0, m = arch_isa_get_n_reg_class(isa); j < m; ++j) {
- node_stat_t node_stat;
-
- chordal_env.cls = arch_isa_get_reg_class(isa, j);
- chordal_env.border_heads = pmap_create();
- chordal_env.ignore_colors = bitset_malloc(chordal_env.cls->n_regs);
-
- stat_tags[STAT_TAG_CLS] = chordal_env.cls->name;
-
- if(stat_file) {
- be_stat_ev_push(stat_tags, STAT_TAG_LAST, stat_file);
-
- /* perform some node statistics. */
- node_stats(&chordal_env, &node_stat);
- be_stat_ev("phis_before_spill", node_stat.n_phis);
- }