X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbestat.c;h=0b25be92ba5a377b504c452b79913c7a3406021c;hb=34e3b8d50bce639e760da7233524a4db85c80290;hp=3d253819ebf21fdd707412940015f3c29e130a22;hpb=6153d2198a2cf1234c50acc744243306bd9ab1a5;p=libfirm diff --git a/ir/be/bestat.c b/ir/be/bestat.c index 3d253819e..0b25be92b 100644 --- a/ir/be/bestat.c +++ b/ir/be/bestat.c @@ -1,20 +1,6 @@ /* - * Copyright (C) 1995-2011 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. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -33,8 +19,8 @@ #include "execfreq.h" #include "firmstat_t.h" #include "irtools.h" -#include "statev.h" #include "error.h" +#include "statev_t.h" #include "bearch.h" #include "beirg.h" @@ -112,16 +98,15 @@ void be_do_stat_reg_pressure(ir_graph *irg, const arch_register_class_t *cls) irg_block_walk_graph(irg, stat_reg_pressure_block, NULL, &env); average_pressure = env.regpressure / env.insn_count; - stat_ev_emit("bechordal_average_register_pressure", average_pressure); - stat_ev_emit("bechordal_maximum_register_pressure", env.max_pressure); + stat_ev_dbl("bechordal_average_register_pressure", average_pressure); + stat_ev_dbl("bechordal_maximum_register_pressure", env.max_pressure); } typedef struct estimate_irg_costs_env_t { - ir_exec_freq *execfreqs; - double costs; + double costs; } estimate_irg_costs_env_t; static void estimate_block_costs(ir_node *block, void *data) @@ -133,15 +118,13 @@ static void estimate_block_costs(ir_node *block, void *data) costs += arch_get_op_estimated_cost(node); } - env->costs += costs * get_block_execfreq(env->execfreqs, block); + env->costs += costs * get_block_execfreq(block); } -double be_estimate_irg_costs(ir_graph *irg, ir_exec_freq *execfreqs) +double be_estimate_irg_costs(ir_graph *irg) { estimate_irg_costs_env_t env; - - env.execfreqs = execfreqs; - env.costs = 0.0; + env.costs = 0.0; irg_block_walk_graph(irg, estimate_block_costs, NULL, &env);