Commit 342c533f authored by Matthias Braun's avatar Matthias Braun
Browse files

minimize number of build variants: always enable statistics

parent 7a6c61de
......@@ -52,7 +52,6 @@ $(srcdir)config.h:
$(Q)echo "#define libfirm_VERSION_MICRO 0" >> $@
$(Q)echo "#define libfirm_VERSION_MINOR 20" >> $@
$(Q)echo "#define HAVE_LONG_DOUBLE 1" >> $@
$(Q)echo "#define FIRM_STATISTICS" >> $@
# libFirm
libfirm_DIRS := \
......
......@@ -131,10 +131,8 @@ static const lc_opt_table_entry_t be_main_options[] = {
LC_OPT_ENT_ENUM_PTR ("verify", "verify the backend irg", &verify_var),
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),
#ifdef FIRM_STATISTICS
LC_OPT_ENT_BOOL ("statev", "dump statistic events", &be_options.statev),
LC_OPT_ENT_STR ("filtev", "filter for stat events (regex if support is active", &be_options.filtev, sizeof(be_options.filtev)),
#endif
#ifdef WITH_ILP
LC_OPT_ENT_STR ("ilp.server", "the ilp server name", be_options.ilp_server, sizeof(be_options.ilp_server)),
......@@ -564,9 +562,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
ir_profile_read(prof_filename);
}
#ifdef FIRM_STATISTICS
stat_active = stat_is_active();
#endif /* FIRM_STATISTICS */
/* For all graphs */
for (i = 0; i < num_birgs; ++i) {
......@@ -717,9 +713,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
/* Do register allocation */
be_allocate_registers(irg);
#ifdef FIRM_STATISTICS
stat_ev_dbl("bemain_costs_before_ra", be_estimate_irg_costs(irg, birg->exec_freq));
#endif
dump(DUMP_RA, irg, "ra");
......@@ -838,7 +832,6 @@ void be_main(FILE *file_handle, const char *cup_name)
ir_timer_reset_and_start(t);
}
#ifdef FIRM_STATISTICS
if (be_options.statev) {
const char *dot = strrchr(cup_name, '.');
const char *pos = dot ? dot : cup_name + strlen(cup_name);
......@@ -850,7 +843,6 @@ void be_main(FILE *file_handle, const char *cup_name)
stat_ev_begin(buf, be_options.filtev);
stat_ev_ctx_push_str("bemain_compilation_unit", cup_name);
}
#endif
be_main_loop(file_handle, cup_name);
......@@ -865,12 +857,10 @@ void be_main(FILE *file_handle, const char *cup_name)
}
}
#ifdef FIRM_STATISTICS
if (be_options.statev) {
stat_ev_ctx_pop("bemain_compilation_unit");
stat_ev_end();
}
#endif
}
static int do_lower_for_target(ir_prog *irp, void *context)
......
......@@ -106,12 +106,10 @@ struct spill_env_t {
ir_nodeset_t mem_phis; /**< set of all spilled phis. */
ir_exec_freq *exec_freq;
#ifdef FIRM_STATISTICS
unsigned spill_count;
unsigned reload_count;
unsigned remat_count;
unsigned spilled_phi_count;
#endif
};
/**
......@@ -162,12 +160,10 @@ spill_env_t *be_new_spill_env(ir_graph *irg)
env->exec_freq = be_get_irg_exec_freq(irg);
obstack_init(&env->obst);
#ifdef FIRM_STATISTICS
env->spill_count = 0;
env->reload_count = 0;
env->remat_count = 0;
env->spilled_phi_count = 0;
#endif
return env;
}
......@@ -427,9 +423,7 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo)
spill->spill = be_spill(block, to_spill);
sched_add_after(skip_Proj(after), spill->spill);
DB((dbg, LEVEL_1, "\t%+F after %+F\n", spill->spill, after));
#ifdef FIRM_STATISTICS
env->spill_count++;
#endif
}
DBG((dbg, LEVEL_1, "\n"));
}
......@@ -477,9 +471,7 @@ static void spill_phi(spill_env_t *env, spill_info_t *spillinfo)
sched_add_after(block, spill->spill);
spillinfo->spills = spill;
#ifdef FIRM_STATISTICS
env->spilled_phi_count++;
#endif
for (i = 0; i < arity; ++i) {
ir_node *arg = get_irn_n(phi, i);
......@@ -647,10 +639,8 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader)
ins[i] = arg;
} else {
ins[i] = do_remat(env, arg, reloader);
#ifdef FIRM_STATISTICS
/* don't count the recursive call as remat */
env->remat_count--;
#endif
}
}
......@@ -667,9 +657,7 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader)
/* insert in schedule */
sched_reset(res);
sched_add_before(reloader, res);
#ifdef FIRM_STATISTICS
env->remat_count++;
#endif
}
return res;
......@@ -959,9 +947,7 @@ void be_insert_spills_reloads(spill_env_t *env)
assert(si->spills != NULL);
copy = be_reload(si->reload_cls, rld->reloader, mode,
si->spills->spill);
#ifdef FIRM_STATISTICS
env->reload_count++;
#endif
}
DBG((dbg, LEVEL_1, " %+F of %+F before %+F\n",
......
......@@ -86,9 +86,7 @@ static void check_reg_pressure_class(pressure_walker_env_t *env,
if (max_live > env->max_pressure)
env->max_pressure = max_live;
#ifdef FIRM_STATISTICS
stat_be_block_regpressure(irg, block, max_live, cls->name);
#endif
ir_nodeset_destroy(&live_nodes);
}
......
......@@ -25,8 +25,6 @@
*/
#include "config.h"
#ifdef FIRM_STATISTICS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -2452,16 +2450,3 @@ int stat_is_active(void)
{
return status != (stat_info_t *)&status_disable;
} /* stat_is_active */
#else
/* initialize the statistics module. */
void firm_init_stat(unsigned enable_options) {}
/* Dumps a statistics snapshot */
void stat_dump_snapshot(const char *name, const char *phase) {}
/* terminates the statistics module, frees all memory */
void stat_term(void);
#endif /* FIRM_STATISTICS */
......@@ -42,8 +42,6 @@
#include "error.h"
#include "lc_printf.h"
#ifdef FIRM_STATISTICS
/*
* just be make some things clear :-), the
* poor man "generics"
......@@ -930,5 +928,3 @@ void stat_finish_pattern_history(const char *fname)
status->enable = 0;
} /* stat_finish_pattern_history */
#endif /* FIRM_STATISTICS */
......@@ -25,8 +25,6 @@
*/
#include "config.h"
#ifdef FIRM_STATISTICS
#include <stdio.h>
#include <stdlib.h>
......@@ -423,5 +421,3 @@ pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern)
return res;
} /* new_vcg_dumper */
#endif /* FIRM_STATISTICS */
......@@ -39,7 +39,7 @@
#include "config.h"
#if defined(FIRM_STATISTICS) && !defined(DISABLE_STATEV)
#ifndef DISABLE_STATEV
#ifdef HAVE_REGEX_H
#define FIRM_HAVE_REGEX
......
......@@ -28,7 +28,7 @@
#ifndef FIRM_STATEVENT_H
#define FIRM_STATEVENT_H
#if !defined(FIRM_STATISTICS) || defined(DISABLE_STATEV)
#ifdef DISABLE_STATEV
#define stat_ev_do(expr)
#define stat_ev_enabled 0
......@@ -151,4 +151,4 @@ void stat_ev_end(void);
#endif
#endif /* FIRM_STATEVENT_H */
#endif
......@@ -82,9 +82,6 @@
first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define to 1 if Firm statistics are activated */
#define FIRM_STATISTICS 1
/* Define the right volatile token */
/* #undef volatile */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment