int cst_idx, var_idx, i, nnr1, nnr2;
char buf[30];
- printf("+++++++++++++++++++++++++++++++ PATH: %d\n", length);
-
/* add cut to ilp */
mangle_cst(buf, 'Q', pi->cst_counter++);
cst_idx = lpp_add_cst(pi->curr_lp, buf, lpp_greater, 1);
pi_add_constr_preColoring(pi);
#endif
- FILE *out = fopen(pi->co->name, "wt");
- lpp_dump_plain(pi->curr_lp, out);
- fclose(out);
-
return pi;
}
pi_set_start_sol(pi);
lpp_solve_net(pi->curr_lp, LPP_HOST, LPP_SOLVER);
// lpp_solve_cplex(pi->curr_lp);
-// printf(" SOLUTION TIME: %.2f\n", pi->curr_lp->sol_time);
+ DBG((dbg, LEVEL_1, "Solution time: %.2f\n", pi->curr_lp->sol_time));
}
/**
static pset *all_phi_nodes;
static pset *all_phi_classes;
static pset *all_copy_nodes;
+static ir_graph *last_irg;
void copystat_init(void) {
dbg = firm_dbg_register("ir.be.copystat");
if (is_Block(node)) /* count all blocks */
curr_vals[I_BLOCKS]++;
- //TODO
if (is_Phi(node) && mode_is_datab(get_irn_mode(node))) /* collect phis */
pset_insert_ptr(all_phi_nodes, node);
pset_insert_ptr(all_copy_nodes, node);
}
-void copystat_collect_irg(ir_graph *irg, arch_env_t *arch_env) {
+static void copystat_collect_irg(ir_graph *irg, arch_env_t *arch_env) {
irg_walk_graph(irg, irg_stat_walker, NULL, arch_env);
- curr_vals[I_BLOCKS] -= 2; /* substract 2 for start and end block */
all_phi_classes = phi_class_compute_by_phis(all_phi_nodes);
+ last_irg = irg;
}
/**
void copystat_collect_cls(be_chordal_env_t *chordal_env) {
ir_node *n;
pset *pc;
+ ir_graph *irg = chordal_env->session_env->irg;
+
+ if (last_irg != irg) {
+ copystat_reset();
+ copystat_collect_irg(irg, chordal_env->session_env->main_env->arch_env);
+ }
for (n = pset_first(all_phi_nodes); n; n = pset_next(all_phi_nodes))
if (is_curr_reg_class(n))
void copystat_init(void);
void copystat_reset(void);
-void copystat_collect_irg(ir_graph *irg, arch_env_t *arch_env);
void copystat_collect_cls(be_chordal_env_t *chordal_env);
void copystat_add_max_costs(int costs);
void copystat_add_inevit_costs(int costs);
#define copy_copystat_init();
#define copystat_reset();
-#define copystat_collect_irg(irg, arch_env);
#define copystat_collect_cls(env);
#define copystat_add_max_costs(costs);
#define copystat_add_inevit_costs(costs);
be_ra_chordal_init();
be_copy_opt_init();
copystat_init();
+ phi_class_init();
}
static be_main_env_t *be_init_env(be_main_env_t *env)
/* Build liveness information */
be_liveness(irg);
- copystat_reset();
- copystat_collect_irg(irg, env.arch_env);
-
/* Perform the following for each register class. */
for(j = 0, m = isa->get_n_reg_class(); j < m; ++j) {
be_chordal_env_t *chordal_env;
#endif
copystat_collect_cls(chordal_env);
+// dump_allocated_irg(env.arch_env, irg, "pre");
be_copy_opt(chordal_env);
+// dump_allocated_irg(env.arch_env, irg, "post");
be_ssa_destruction(chordal_env);
be_ssa_destruction_check(chordal_env);