* @author Christian Wuerdig, Matthias Braun
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
#include <time.h>
#include "statev.h"
#include "error.h"
-#include "bearch_t.h"
-#include "beirg_t.h"
+#include "bearch.h"
+#include "beirg.h"
#include "bestat.h"
#include "belive_t.h"
#include "besched.h"
-#include "benode_t.h"
+#include "benode.h"
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);
}
typedef struct _estimate_irg_costs_env_t {
- const arch_env_t *arch_env;
ir_exec_freq *execfreqs;
double costs;
} estimate_irg_costs_env_t;
env->costs += costs * get_block_execfreq(env->execfreqs, block);
}
-double be_estimate_irg_costs(ir_graph *irg, const arch_env_t *arch_env, ir_exec_freq *execfreqs)
+double be_estimate_irg_costs(ir_graph *irg, ir_exec_freq *execfreqs)
{
estimate_irg_costs_env_t env;
- env.arch_env = arch_env;
env.execfreqs = execfreqs;
env.costs = 0.0;
-static be_node_stats_t *stats;
-
static void node_stat_walker(ir_node *irn, void *data)
{
- (void) data;
+ be_node_stats_t *const stats = data;
/* if the node is a normal phi */
if(is_Phi(irn)) {
} else {
(*stats)[BE_STAT_PHIS]++;
}
- } else {
+ } else if (!is_Proj(irn)) {
arch_irn_class_t classify = arch_irn_classify(irn);
if(classify & arch_irn_class_spill)
void be_collect_node_stats(be_node_stats_t *new_stats, be_irg_t *birg)
{
- stats = new_stats;
-
- memset(stats, 0, sizeof(*stats));
- irg_walk_graph(birg->irg, NULL, node_stat_walker, NULL);
+ memset(new_stats, 0, sizeof(*new_stats));
+ irg_walk_graph(birg->irg, NULL, node_stat_walker, new_stats);
}
void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub)
switch(get_irn_opcode(irn)) {
case iro_Proj:
case iro_Phi:
- case iro_Start:
+ case beo_Start:
case iro_End:
break;
default: