int scheduler; /**< the scheduler */
char ilp_server[128]; /**< the ilp server name */
char ilp_solver[128]; /**< the ilp solver name */
- char stat_file_name[256]; /**< name of the file where the statistics are put to */
+ int statev; /**< enable stat event dumping */
};
struct be_main_env_t {
be_lv_t *lv = env->birg->lv;
int i, n;
+ bitset_pos_t elm;
unsigned step = 0;
unsigned pressure = 0;
struct list_head *head;
- 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);
* Make final uses of all values live out of the block.
* They are necessary to build up real intervals.
*/
- foreach_pset(live_end, irn) {
+ be_lv_foreach(lv, block, be_lv_state_end, i) {
+ ir_node *irn = be_lv_get_irn(lv, block, i);
if(has_reg_class(env, irn)) {
DBG((dbg, LEVEL_3, "\tMaking live: %+F/%d\n", irn, get_irn_idx(irn)));
bitset_set(live, get_irn_idx(irn));
++step;
}
- /*
- * Add initial defs for all values live in.
- */
- foreach_pset(live_in, irn) {
- if(has_reg_class(env, irn)) {
-
- /* Mark the value live in. */
- bitset_set(live, get_irn_idx(irn));
-
- /* Add the def */
+ bitset_foreach(live, elm) {
+ ir_node *irn = get_idx_irn(env->irg, elm);
+ if (be_is_live_in(lv, block, irn))
border_def(irn, step, 0);
- }
}
-
- del_pset(live_in);
- del_pset(live_end);
}
static void assign(ir_node *block, void *env_ptr)
chordal_env->border_heads = pmap_create();
chordal_env->ignore_colors = bitset_malloc(chordal_env->cls->n_regs);
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- be_stat_tags[STAT_TAG_CLS] = pse->cls->name;
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
-
- /* perform some node statistics. */
- node_stats(birg, pse->cls, &node_stat);
- be_stat_ev("phis_before_spill", node_stat.n_phis);
- }
-#endif /* FIRM_STATISTICS */
+ be_assure_liveness(birg);
+ be_liveness_assure_chk(be_get_birg_liveness(birg));
+ stat_ev_ctx_push("cls", pse->cls->name);
+ stat_ev_dbl("phis_before_spill", node_stat.n_phis);
+ stat_ev_do(node_stats(birg, pse->cls, &node_stat));
/* put all ignore registers into the ignore register set. */
be_put_ignore_regs(birg, pse->cls, chordal_env->ignore_colors);
be_pre_spill_prepare_constr(chordal_env);
dump(BE_CH_DUMP_CONSTR, birg->irg, pse->cls, "-constr-pre", dump_ir_block_graph_sched);
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- pse->pre_spill_cost = be_estimate_irg_costs(birg->irg,
- birg->main_env->arch_env, birg->exec_freq);
- be_stat_ev_pop();
- }
-#endif /* FIRM_STATISTICS */
+ stat_ev_ctx_pop();
}
/**
/* some special classes contain only ignore regs, no work to be done */
if (allocatable_regs > 0) {
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- double spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost;
-
- be_stat_tags[STAT_TAG_CLS] = pse->cls->name;
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
-
- be_stat_ev_l("spillcosts", (long) spillcosts);
-
- node_stats(birg, pse->cls, &node_stat);
- be_stat_ev("phis_after_spill", node_stat.n_phis);
- be_stat_ev("mem_phis", node_stat.n_mem_phis);
- be_stat_ev("reloads", node_stat.n_reloads);
- be_stat_ev("spills", node_stat.n_spills);
- }
-#endif /* FIRM_STATISTICS */
+ stat_ev_ctx_push("cls", pse->cls->name);
+ stat_ev_do(node_stats(birg, pse->cls, &node_stat));
+ stat_ev_dbl("spillcosts", be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost);
+ stat_ev_dbl("phis_after_spill", node_stat.n_phis);
+ stat_ev_dbl("mem_phis", node_stat.n_mem_phis);
+ stat_ev_dbl("reloads", node_stat.n_reloads);
+ stat_ev_dbl("spills", node_stat.n_spills);
/*
If we have a backend provided spiller, post spill is
chordal_env->ifg = be_create_ifg(chordal_env);
BE_TIMER_POP(ra_timer.t_ifg);
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
+ {
be_ifg_stat_t stat;
- be_ifg_stat(birg, chordal_env->ifg, &stat);
- be_stat_ev("ifg_nodes", stat.n_nodes);
- be_stat_ev("ifg_edges", stat.n_edges);
- be_stat_ev("ifg_comps", stat.n_comps);
+ stat_ev_do(be_ifg_stat(birg, chordal_env->ifg, &stat));
+ stat_ev_dbl("ifg_nodes", stat.n_nodes);
+ stat_ev_dbl("ifg_edges", stat.n_edges);
+ stat_ev_dbl("ifg_comps", stat.n_comps);
- node_stats(birg, pse->cls, &node_stat);
- be_stat_ev("perms_before_coal", node_stat.n_perms);
- be_stat_ev("copies_before_coal", node_stat.n_copies);
+ stat_ev_do(node_stats(birg, pse->cls, &node_stat));
+ stat_ev_dbl("perms_before_coal", node_stat.n_perms);
+ stat_ev_dbl("copies_before_coal", node_stat.n_copies);
}
-#endif /* FIRM_STATISTICS */
/* copy minimization */
BE_TIMER_PUSH(ra_timer.t_copymin);
}
BE_TIMER_POP(ra_timer.t_verify);
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- node_stats(birg, pse->cls, &node_stat);
- be_stat_ev("perms_after_coal", node_stat.n_perms);
- be_stat_ev("copies_after_coal", node_stat.n_copies);
- be_stat_ev_pop();
- }
-#endif /* FIRM_STATISTICS */
+ stat_ev_do(node_stats(birg, pse->cls, &node_stat));
+ stat_ev_dbl("perms_after_coal", node_stat.n_perms);
+ stat_ev_dbl("copies_after_coal", node_stat.n_copies);
+ stat_ev_ctx_pop();
/* the ifg exists only if there are allocatable regs */
be_ifg_free(chordal_env->ifg);
}
}
+ be_verify_register_allocation(main_env->arch_env, irg);
+
+
BE_TIMER_PUSH(ra_timer.t_epilog);
lower_nodes_after_ra(birg, options.lower_perm_opt & BE_CH_LOWER_PERM_COPY ? 1 : 0);
dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched);
DBG((env->dbg, LEVEL_1, "ILP to solve: %u variables, %u constraints\n", lpp->var_next, lpp->cst_next));
/* debug stuff, dump lpp when debugging is on */
- DEBUG_ONLY(
+ DEBUG_ONLY_NICE {
if (firm_dbg_get_mask(env->dbg) > 1) {
char buf[1024];
FILE *f;
snprintf(buf, sizeof(buf), "lpp_block_%lu.mps", get_irn_node_nr(block));
lpp_dump(lpp, buf);
}
- );
+ }
/* set solve time limit */
lpp_set_time_limit(lpp, env->opts->time_limit);
char buf[1024];
FILE *f;
- DEBUG_ONLY(
+ DEBUG_ONLY_NICE {
if (firm_dbg_get_mask(env->dbg) >= 2) {
snprintf(buf, sizeof(buf), "lpp_block_%lu.infeasible.txt", get_irn_node_nr(block));
f = fopen(buf, "w");
lpp_dump(lpp, buf);
dump_ir_block_graph(env->irg, "-infeasible");
}
- )
+ }
ir_fprintf(stderr, "ILP found no solution within time (%+F, %+F), falling back to heuristics.\n", block, env->irg);
need_heur = 1;
}
/* apply solution */
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- be_stat_ev("nodes", ba->block_last_idx);
- be_stat_ev("vars", lpp ? lpp->var_next : 0);
- be_stat_ev("csts", lpp ? lpp->cst_next : 0);
- }
-#endif /* FIRM_STATISTICS */
+ be_stat_ev("nodes", ba->block_last_idx);
+ be_stat_ev("vars", lpp ? lpp->var_next : 0);
+ be_stat_ev("csts", lpp ? lpp->cst_next : 0);
if (need_heur) {
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
be_stat_ev("time", -1);
be_stat_ev_dbl("opt", 0.0);
- }
-#endif /* FIRM_STATISTICS */
list_sched_single_block(env->birg, block, env->be_opts);
}
else {
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- if (lpp) {
- double opt = lpp->sol_state == lpp_optimal ? 100.0 : 100.0 * lpp->best_bound / lpp->objval;
- be_stat_ev_dbl("time", lpp->sol_time);
- be_stat_ev_dbl("opt", opt);
- }
- else {
- be_stat_ev_dbl("time", 0.0);
- be_stat_ev_dbl("opt", 100.0);
- }
+ if (lpp) {
+ double opt = lpp->sol_state == lpp_optimal ? 100.0 : 100.0 * lpp->best_bound / lpp->objval;
+ be_stat_ev_dbl("time", lpp->sol_time);
+ be_stat_ev_dbl("opt", opt);
+ }
+ else {
+ be_stat_ev_dbl("time", 0.0);
+ be_stat_ev_dbl("opt", 100.0);
}
-#endif /* FIRM_STATISTICS */
apply_solution(env, lpp, block);
}
FIRM_DBG_REGISTER(env.dbg, "firm.be.sched.ilp");
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- be_stat_tags[STAT_TAG_CLS] = "ilpsched";
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
- }
-#endif /* FIRM_STATISTICS */
+ stat_ev_ctx_push("phase", "ilpsched");
// firm_dbg_set_mask(env.dbg, 1);
/* notify backend */
be_ilp_sched_finish_irg_ilp_schedule(sel, birg->irg, env.irg_env);
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- be_stat_ev_pop();
- }
-#endif /* FIRM_STATISTICS */
+ stat_ev_ctx_pop();
}
/**
}
/* List schedule a graph. */
-void list_sched(const be_irg_t *birg, be_options_t *be_opts)
+void list_sched(be_irg_t *birg, be_options_t *be_opts)
{
const arch_env_t *arch_env = birg->main_env->arch_env;
ir_graph *irg = birg->irg;
* @param birg The backend irg.
* @param be_opts The backend options
*/
-void list_sched(const be_irg_t *birg, be_options_t *be_opts);
+void list_sched(be_irg_t *birg, be_options_t *be_opts);
/**
* List schedule a block.
static int node_idx_cmp(const void *a, const void *b)
{
- int ia = get_irn_idx(a);
- int ib = get_irn_idx(b);
+ const ir_node *p = *(ir_node **) a;
+ const ir_node *q = *(ir_node **) b;
+ int ia = get_irn_idx(p);
+ int ib = get_irn_idx(q);
return ia - ib;
}
void be_liveness_assure_chk(be_lv_t *lv)
{
#ifndef USE_LIVE_CHK
- be_liveness_assure_sets(be_lv_t *lv);
+ be_liveness_assure_sets(lv);
#else
(void) lv;
#endif
memset(lv, 0, sizeof(lv[0]));
lv->irg = irg;
+#ifdef USE_LIVE_CHK
lv->lvc = lv_chk_new(irg);
+#endif
lv->hook_info.context = lv;
lv->hook_info.hook._hook_node_info = lv_dump_block;
return (lv_chk_bl_xxx(li->lvc, block, irn) & flags) != 0;
#else
assert(li->nodes && "node sets must be computed");
+ return 0;
#endif /* USE_LIVE_CHK */
}
should be ok.
*/
sched_point = sched_prev(irn);
+ DBG((mod, LEVEL_1, "perm: %+F\n", irn));
DBG((mod, LEVEL_1, "sched point is %+F\n", sched_point));
assert(sched_point && "Perm is not scheduled or has no predecessor");
static void lower_nodes_after_ra_walker(ir_node *irn, void *walk_env) {
if (! is_Block(irn) && ! is_Proj(irn)) {
if (be_is_Perm(irn)) {
- int perm_stayed = push_through_perm(irn, walk_env);
+ int perm_stayed = 1; //push_through_perm(irn, walk_env);
if (perm_stayed)
lower_perm_node(irn, walk_env);
}
BE_SCHED_LIST, /* scheduler: list scheduler */
"i44pc52.info.uni-karlsruhe.de", /* ilp server */
"cplex", /* ilp solver */
- "", /* filename for statistic output */
+ 0, /* enable statistic event dumping */
};
/* config file. */
LC_OPT_ENT_BOOL ("time", "get backend timing statistics", &be_options.timing),
LC_OPT_ENT_BOOL ("profile", "instrument the code for execution count profiling", &be_options.opt_profile),
LC_OPT_ENT_ENUM_PTR ("sched", "select a scheduler", &sched_var),
- LC_OPT_ENT_STR ("statfile", "append statistics to file statfile", &be_options.stat_file_name, sizeof(be_options.stat_file_name)),
+ LC_OPT_ENT_BOOL ("statev", "dump statistic events", &be_options.statev),
#ifdef WITH_ILP
LC_OPT_ENT_STR ("ilp.server", "the ilp server name", be_options.ilp_server, sizeof(be_options.ilp_server)),
ir_graph *irg = birg->irg;
optimization_state_t state;
const arch_code_generator_if_t *cg_if;
- char irg_name[128];
/* set the current graph (this is important for several firm functions) */
current_ir_graph = irg;
#ifdef FIRM_STATISTICS
- if(be_stat_ev_is_active()) {
- ir_snprintf(irg_name, sizeof(irg_name), "%F", irg);
- be_stat_tags[STAT_TAG_CLS] = "<all>";
- be_stat_tags[STAT_TAG_IRG] = irg_name;
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
- }
+ stat_ev_ctx_push_fobj("irg", irg);
#endif
/* stop and reset timers */
be_do_stat_reg_pressure(birg);
#ifdef FIRM_STATISTICS
- if(be_stat_ev_is_active()) {
- be_stat_ev_l("costs_before_ra",
- (long) be_estimate_irg_costs(irg, env.arch_env, birg->exec_freq));
- }
+ stat_ev_dbl("costs_before_ra", be_estimate_irg_costs(irg, env.arch_env, birg->exec_freq));
#endif
/* Do register allocation */
BE_TIMER_POP(t_regalloc);
#ifdef FIRM_STATISTICS
- if(be_stat_ev_is_active()) {
- be_stat_ev_l("costs_after_ra",
- (long) be_estimate_irg_costs(irg, env.arch_env, birg->exec_freq));
- }
+ stat_ev_dbl("costs_before_ra", be_estimate_irg_costs(irg, env.arch_env, birg->exec_freq));
#endif
dump(DUMP_RA, irg, "-ra", dump_ir_block_graph_sched);
BE_TIMER_POP(t_other);
#define LC_EMIT(timer) \
- if(!be_stat_ev_is_active()) { \
printf("%-20s: %.3lf msec\n", lc_timer_get_description(timer), (double)lc_timer_elapsed_usec(timer) / 1000.0); \
- } else { \
- be_stat_ev_l(lc_timer_get_name(timer), lc_timer_elapsed_msec(timer)); \
- }
+ stat_ev_dbl(lc_timer_get_name(timer), lc_timer_elapsed_msec(timer));
+
#define LC_EMIT_RA(timer) \
- if(!be_stat_ev_is_active()) { \
printf("\t%-20s: %.3lf msec\n", lc_timer_get_description(timer), (double)lc_timer_elapsed_usec(timer) / 1000.0); \
- } else { \
- be_stat_ev_l(lc_timer_get_name(timer), lc_timer_elapsed_msec(timer)); \
- }
+ stat_ev_dbl(lc_timer_get_name(timer), lc_timer_elapsed_msec(timer)); \
+
BE_TIMER_ONLY(
- if(!be_stat_ev_is_active()) {
- printf("==>> IRG %s <<==\n", get_entity_name(get_irg_entity(irg)));
- printf("# nodes at begin: %u\n", num_nodes_b);
- printf("# nodes before ra: %u\n", num_nodes_r);
- printf("# nodes at end: %u\n\n", num_nodes_a);
- }
+ printf("==>> IRG %s <<==\n", get_entity_name(get_irg_entity(irg)));
+ printf("# nodes at begin: %u\n", num_nodes_b);
+ printf("# nodes before ra: %u\n", num_nodes_r);
+ printf("# nodes at end: %u\n\n", num_nodes_a);
LC_EMIT(t_abi);
LC_EMIT(t_codegen);
LC_EMIT(t_sched);
#endif /* FIRM_STATISTICS */
free_ir_graph(irg);
#endif /* if 0 */
- if(be_stat_ev_is_active()) {
- be_stat_ev_pop();
- }
+ stat_ev_ctx_pop();
}
be_profile_free();
be_done_env(&env);
lc_timer_reset_and_start(t);
}
-#ifdef FIRM_STATISTICS
- be_init_stat_file(be_options.stat_file_name, cup_name);
-#endif
+ if (be_options.statev) {
+ const char *dot = rindex(cup_name, '.');
+ const char *pos = dot ? dot : cup_name + strlen(cup_name);
+ char *buf = alloca(pos - cup_name + 1);
+ strncpy(buf, cup_name, pos - cup_name);
+
+ stat_ev_begin(buf);
+ }
/* never build code for pseudo irgs */
set_visit_pseudo_irgs(0);
if (be_options.timing == BE_TIME_ON) {
lc_timer_stop(t);
lc_timer_leave_high_priority();
- if(be_stat_ev_is_active()) {
- be_stat_ev_l("backend_time", lc_timer_elapsed_msec(t));
- } else {
- printf("%-20s: %lu msec\n", "BEMAINLOOP", lc_timer_elapsed_msec(t));
- }
+ stat_ev_dbl("backend_time", lc_timer_elapsed_msec(t));
+ printf("%-20s: %lu msec\n", "BEMAINLOOP", lc_timer_elapsed_msec(t));
}
-#ifdef FIRM_STATISTICS
- be_close_stat_file();
-#endif
+ if (be_options.statev)
+ stat_ev_end();
}
/** The debug info retriever function. */
env->liveness = be_liveness(irg);
FIRM_DBG_REGISTER(env->dbg, "firm.be.sched.trace");
+ be_liveness_assure_chk(env->liveness);
memset(env->sched_info, 0, nn * sizeof(*(env->sched_info)));
return env;
si->reloaders = NULL;
}
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- be_stat_ev("spill_spills", env->spill_count);
- be_stat_ev("spill_reloads", env->reload_count);
- be_stat_ev("spill_remats", env->remat_count);
- be_stat_ev("spill_spilled_phis", env->spilled_phi_count);
- }
-#endif
+ stat_ev_dbl("spill_spills", env->spill_count);
+ stat_ev_dbl("spill_reloads", env->reload_count);
+ stat_ev_dbl("spill_remats", env->remat_count);
+ stat_ev_dbl("spill_spilled_phis", env->spilled_phi_count);
/* Matze: In theory be_ssa_construction should take care of the liveness...
* try to disable this again in the future */
// insert node into schedule
blockend = get_end_of_block_insertion_point(memperm->block);
sched_add_before(blockend, mempermnode);
- be_stat_ev("mem_perm", memperm->entrycount);
+ stat_ev_dbl("mem_perm", memperm->entrycount);
i = 0;
for(entry = memperm->entries; entry != NULL; entry = entry->next, ++i) {
void be_assign_entities(be_fec_env_t *env)
{
- if(be_stat_ev_is_active()) {
- int count = set_count(env->spills);
- be_stat_ev("spillslots", count);
- }
+ stat_ev_dbl("spillslots", set_count(env->spills));
if(be_coalesce_spill_slots) {
do_greedy_coalescing(env);
}
- if(be_stat_ev_is_active()) {
- int count = count_spillslots(env);
- be_stat_ev("spillslots_after_coalescing", count);
- }
+ stat_ev_dbl("spillslots_after_coalescing", count_spillslots(env));
assign_spillslots(env);
FIRM_DBG_REGISTER(dbg, "ir.be.ssadestr");
+ be_liveness_invalidate(lv);
be_liveness_assure_sets(lv);
/* create a map for fast lookup of perms: block --> perm */
#include "firmstat_t.h"
#include "irtools.h"
#include "pset.h"
+#include "statev.h"
#include "bearch_t.h"
#include "bestat.h"
#ifdef FIRM_STATISTICS
-const char *be_stat_tags[STAT_TAG_LAST];
-FILE *be_stat_file = NULL;
-
-void be_init_stat_file(const char *stat_file_name, const char *sourcefilename)
-{
- static char time_str[32];
-
- assert(be_stat_file == NULL);
-
- /* if we want to do some statistics, push the environment. */
- if (strlen(stat_file_name) == 0)
- return;
-
- be_stat_file = fopen(stat_file_name, "at");
- if (be_stat_file == NULL) {
- fprintf(stderr, "Warning couldn't open statfile '%s'\n", stat_file_name);
- return;
- }
-
- /* initialize the statistics tags */
- ir_snprintf(time_str, sizeof(time_str),"%u", time(NULL));
-
- be_stat_tags[STAT_TAG_FILE] = sourcefilename;
- be_stat_tags[STAT_TAG_TIME] = time_str;
- be_stat_tags[STAT_TAG_IRG] = "<all>";
- be_stat_tags[STAT_TAG_CLS] = "<all>";
-
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
-}
-
-void be_close_stat_file()
-{
- be_stat_ev_pop();
- if (be_stat_file != NULL) {
- fclose(be_stat_file);
- be_stat_file = NULL;
- }
-}
#else /* FIRM_STATISTICS */
+++ /dev/null
-/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Statistic events.
- * @author Sebastian Hack
- * @date 03.09.2006
- * @version $Id$
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <assert.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "bestatevent.h"
-
-#define STACK_SIZE 16
-
-typedef struct {
- FILE *f;
- char tag[512];
-} ev_env_t;
-
-static ev_env_t envs[STACK_SIZE];
-static unsigned sp = 0;
-
-void be_stat_ev_push(const char **tags, int n_tags, FILE *f)
-{
- int i;
- ev_env_t *env;
-
- assert(sp < STACK_SIZE && "stat event stack full");
- env = &envs[sp++];
-
- env->tag[0] = '\0';
- for(i = 0; i < n_tags; ++i) {
- strncat(env->tag, tags[i], sizeof(env->tag));
- strncat(env->tag, ";", sizeof(env->tag));
- }
- env->tag[sizeof(env->tag) - 1] = '\0';
- env->f = f;
-}
-
-void be_stat_ev_pop(void)
-{
- if (sp == 0)
- return;
-
- envs[--sp].f = NULL;
-}
-
-void be_stat_ev(const char *ev, int value)
-{
- ev_env_t *env;
-
- if (sp == 0)
- return;
-
- env = &envs[sp - 1];
- if (env->f == NULL)
- return;
-
- fprintf(env->f, "%s%s;%d\n", env->tag, ev, value);
-}
-
-void be_stat_ev_l(const char *ev, long value)
-{
- ev_env_t *env;
-
- if (sp == 0)
- return;
-
- env = &envs[sp - 1];
- if (env->f == NULL)
- return;
-
- fprintf(env->f, "%s%s;%ld\n", env->tag, ev, value);
-}
-
-void be_stat_ev_dbl(const char *ev, double value)
-{
- ev_env_t *env;
-
- if (sp == 0)
- return;
-
- env = &envs[sp - 1];
- if (env->f == NULL)
- return;
-
- fprintf(env->f, "%s%s;%f\n", env->tag, ev, value);
-}
-
-void be_stat_ev_ull(const char *ev, ulong64 value)
-{
- ev_env_t *env;
-
- if (sp == 0)
- return;
-
- env = &envs[sp - 1];
- if (env->f == NULL)
- return;
-
- fprintf(env->f, "%s%s;%" ULL_FMT "\n", env->tag, ev, value);
-}
-
-int be_stat_ev_is_active(void)
-{
- return sp > 0 && envs[sp - 1].f != NULL;
-}
#include <stdio.h>
#include "firm_types.h"
+#include "statev.h"
-void be_stat_ev_push(const char **tags, int n_tags, FILE *f);
-void be_stat_ev_pop(void);
-
-void be_stat_ev(const char *ev, int value);
-void be_stat_ev_l(const char *ev, long value);
-void be_stat_ev_dbl(const char *ev, double value);
-void be_stat_ev_ull(const char *ev, ulong64 value);
-
-int be_stat_ev_is_active(void);
+#define be_stat_ev(name, val) stat_ev_dbl(name, val)
+#define be_stat_ev_l(name, val) stat_ev_dbl(name, val)
+#define be_stat_ev_dbl(name, val) stat_ev_dbl(name, val)
+#define be_stat_ev_ull(name, val) stat_ev_dbl(name, val)
#endif /* FIRM_BE_BESTATEVENT_H */
/* recalculate edges */
edges_deactivate(irg);
edges_activate(irg);
+
+ if (birg->lv) {
+ be_liveness_free(birg->lv);
+ birg->lv = be_liveness(birg->irg);
+ }
}