* @file
* @brief Provides several statistic functions for the backend.
* @author Christian Wuerdig, Matthias Braun
- * @version $Id$
*/
#include "config.h"
ir_node *block,
const arch_register_class_t *cls)
{
- ir_graph *irg = env->irg;
- ir_node *irn;
- ir_nodeset_t live_nodes;
- size_t max_live;
+ ir_graph *irg = env->irg;
+ ir_nodeset_t live_nodes;
+ size_t max_live;
ir_nodeset_init(&live_nodes);
be_liveness_end_of_block(env->lv, cls, block, &live_nodes);
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);
}
env.insn_count = 0;
env.max_pressure = 0;
env.regpressure = 0;
- be_liveness_assure_sets(be_assure_liveness(irg));
+ be_assure_live_sets(irg);
env.lv = be_get_irg_liveness(irg);
env.cls = cls;
static void estimate_block_costs(ir_node *block, void *data)
{
estimate_irg_costs_env_t *env = (estimate_irg_costs_env_t*)data;
- ir_node *node;
- double costs = 0.0;
+ double costs = 0.0;
sched_foreach(block, node) {
costs += arch_get_op_estimated_cost(node);
} else {
(*stats)[BE_STAT_PHIS]++;
}
- } else if (!is_Proj(irn)) {
- arch_irn_class_t classify = arch_irn_classify(irn);
-
- if (classify & arch_irn_class_spill)
- (*stats)[BE_STAT_SPILLS]++;
- if (classify & arch_irn_class_reload)
- (*stats)[BE_STAT_RELOADS]++;
- if (classify & arch_irn_class_remat)
- (*stats)[BE_STAT_REMATS]++;
- if (classify & arch_irn_class_copy)
- (*stats)[BE_STAT_COPIES]++;
- if (classify & arch_irn_class_perm)
- (*stats)[BE_STAT_PERMS]++;
+ } else if (be_is_Perm(irn)) {
+ (*stats)[BE_STAT_PERMS]++;
+ } else if (be_is_Copy(irn)) {
+ (*stats)[BE_STAT_COPIES]++;
}
}
case BE_STAT_MEM_PHIS: return "mem_phis";
case BE_STAT_COPIES: return "copies";
case BE_STAT_PERMS: return "perms";
- case BE_STAT_SPILLS: return "spills";
- case BE_STAT_RELOADS: return "reloads";
- case BE_STAT_REMATS: return "remats";
default: panic("unknown stat tag found");
}
}
static void block_count_walker(ir_node *node, void *data)
{
unsigned long *cnt = (unsigned long*)data;
- if (node == get_irg_end_block(current_ir_graph))
+ if (node == get_irg_end_block(get_irn_irg(node)))
return;
(*cnt)++;
}