* @brief Copy minimization driver.
* @author Daniel Grund
* @date 12.04.2005
- * @version $Id$
*
* Main file for the optimization reducing the copies needed for:
* - Phi coalescing
#include "irprog.h"
#include "irloop_t.h"
#include "iredges_t.h"
-#include "irbitset.h"
#include "irprintf_t.h"
#include "irtools.h"
+#include "util.h"
#include "bemodule.h"
#include "bearch.h"
void co_complete_stats(const copy_opt_t *co, co_complete_stats_t *stat)
{
- bitset_t *seen = bitset_irg_malloc(co->irg);
+ bitset_t *seen = bitset_malloc(get_irg_last_idx(co->irg));
affinity_node_t *an;
memset(stat, 0, sizeof(stat[0]));
co_gs_foreach_aff_node(co, an) {
neighb_t *neigh;
stat->aff_nodes += 1;
- bitset_add_irn(seen, an->irn);
+ bitset_set(seen, get_irn_idx(an->irn));
co_gs_foreach_neighb(an, neigh) {
- if (!bitset_contains_irn(seen, neigh->irn)) {
+ if (!bitset_is_set(seen, get_irn_idx(neigh->irn))) {
stat->aff_edges += 1;
stat->max_costs += neigh->costs;
co_complete_stats(co, &after);
if (do_stats) {
- ulong64 optimizable_costs = after.max_costs - after.inevit_costs;
- ulong64 evitable = after.costs - after.inevit_costs;
+ unsigned long long optimizable_costs = after.max_costs - after.inevit_costs;
+ unsigned long long evitable = after.costs - after.inevit_costs;
ir_printf("%30F ", cenv->irg);
- printf("%10s %10" ULL_FMT "%10" ULL_FMT "%10" ULL_FMT, cenv->cls->name, after.max_costs, before.costs, after.inevit_costs);
+ printf("%10s %10llu%10llu%10llu", cenv->cls->name, after.max_costs, before.costs, after.inevit_costs);
if (optimizable_costs > 0)
- printf("%10" ULL_FMT " %5.2f\n", after.costs, (evitable * 100.0) / optimizable_costs);
+ printf("%10llu %5.2f\n", after.costs, (evitable * 100.0) / optimizable_costs);
else
- printf("%10" ULL_FMT " %5s\n", after.costs, "-");
+ printf("%10llu %5s\n", after.costs, "-");
}
/* Dump the interference graph in Appel's format. */