#define NO_COLOR (-1)
-#define DUMP_INTERVALS
+#undef DUMP_INTERVALS
#undef DUMP_PRESSURE
#undef DUMP_IFG
dbg = firm_dbg_register("ir.be.copyoptheur");
firm_dbg_set_mask(dbg, DEBUG_LVL);
if (!strcmp(co->name, DEBUG_IRG))
- firm_dbg_set_mask(dbg, -1);
+ firm_dbg_set_mask(dbg, DEBUG_LVL_HEUR);
+ else
+ firm_dbg_set_mask(dbg, DEBUG_LVL);
pinned_global = pset_new_ptr(SLOTS_PINNED_GLOBAL);
list_for_each_entry(unit_t, curr, &co->units, units)
dbg = firm_dbg_register("ir.be.copyoptilp");
if (!strcmp(co->name, DEBUG_IRG))
- firm_dbg_set_mask(dbg, -1);
+ firm_dbg_set_mask(dbg, DEBUG_LVL_ILP);
else
firm_dbg_set_mask(dbg, DEBUG_LVL);
static void co_append_unit(copy_opt_t *co, ir_node *root) {
int i, arity;
unit_t *unit;
- DBG((dbg, LEVEL_1, "\t Root: %n\n", root));
+ DBG((dbg, LEVEL_1, "\t Root: %n %N\n", root, root));
/* check if we encountered this root earlier */
if (pset_find_ptr(co->roots, root))
return;
assert(is_curr_reg_class(arg) && "Argument not in same register class.");
if (arg != root) {
if (!nodes_interfere(co->chordal_env, root, arg)) {
- DBG((dbg, LEVEL_1, "\t Member: %n\n", arg));
+ DBG((dbg, LEVEL_1, "\t Member: %n %N\n", arg, arg));
if (is_optimizable(arg))
co_append_unit(co, arg);
unit->nodes[unit->node_count++] = arg;
s3 = chordal_env->cls->name;
len = strlen(s1) + strlen(s2) + strlen(s3) + 5;
co->name = xmalloc(len);
- if (!strcmp(co->name, DEBUG_IRG))
- firm_dbg_set_mask(dbg, -1);
snprintf(co->name, len, "%s__%s__%s", s1, s2, s3);
+ if (!strcmp(co->name, DEBUG_IRG))
+ firm_dbg_set_mask(dbg, DEBUG_LVL_CO);
+ else
+ firm_dbg_set_mask(dbg, DEBUG_LVL);
INIT_LIST_HEAD(&co->units);
co_collect_units(co);
list_for_each_entry(unit_t, curr, &co->units, units) {
int root_col = get_irn_col(co, curr->nodes[0]);
res += curr->interf;
+ DBG((dbg, LEVEL_1, "%n %N has %d intf\n", curr->nodes[0], curr->nodes[0], curr->interf));
for (i=1; i<curr->node_count; ++i)
- if (root_col != get_irn_col(co, curr->nodes[i]))
+ if (root_col != get_irn_col(co, curr->nodes[i])) {
+ DBG((dbg, LEVEL_1, " %n %N\n", curr->nodes[i], curr->nodes[i]));
res++;
+ }
}
return res;
}
#include "bechordal_t.h"
#include "bearch.h"
-#define DEBUG_IRG "-scanner.c__init_td__gp"
+#define DEBUG_IRG "NONE spec.c__main__datab"
+#define DEBUG_LVL_CO LEVEL_1
+#define DEBUG_LVL_HEUR LEVEL_1
+#define DEBUG_LVL_ILP LEVEL_1
+
//TODO is_Perm
#define is_Perm(irn) 0
static firm_dbg_module_t *dbg = NULL;
void be_copy_opt_init(void) {
- dbg = firm_dbg_register("ir.be.copyopt");
+ dbg = firm_dbg_register("ir.be.copyoptmain");
firm_dbg_set_mask(dbg, LEVEL_1);
}
* - phi coalescing
* - register-constrained nodes
*
- * Checker included.
- * By request some statistics are collected too.
*/
#ifndef _BECOPYOPTMAIN_H
#endif
#include <string.h>
-#include "phiclass_t.h"
+#include "irgraph.h"
#include "irprog.h"
+#include "phiclass_t.h"
#include "becopyopt.h"
#include "becopystat.h"
#include "xmalloc.h"
#ifdef DO_STAT
+#define DEBUG_LVL 0 //SET_LEVEL_1
+static firm_dbg_module_t *dbg = NULL;
+
static pset *all_phi_nodes;
static pset *all_phi_classes;
static pset *all_copy_nodes;
void copystat_init(void) {
+ dbg = firm_dbg_register("ir.be.copystat");
+ firm_dbg_set_mask(dbg, DEBUG_LVL);
+
all_phi_nodes = pset_new_ptr_default();
all_phi_classes = pset_new_ptr_default();
all_copy_nodes = pset_new_ptr_default();
phi_class_init();
-
}
void copystat_reset(void) {
int i;
for (i = 0; i < ASIZE; ++i)
curr_vals[i] = 0;
+ del_pset(all_phi_nodes);
+ del_pset(all_phi_classes);
+ del_pset(all_copy_nodes);
+ all_phi_nodes = pset_new_ptr_default();
+ all_phi_classes = pset_new_ptr_default();
+ all_copy_nodes = pset_new_ptr_default();
}
/**
if (phi != arg) {
curr_vals[I_COPIES_MAX]++; /* if arg!=phi this is a possible copy */
- if (nodes_interfere(chordal_env, phi, arg))
+ if (nodes_interfere(chordal_env, phi, arg)) {
+ DBG((dbg, LEVEL_1, "%e -- In Block %N: %n %N %n %N\n", get_irg_entity(chordal_env->irg), get_nodes_block(phi), phi, phi, arg, arg));
curr_vals[I_COPIES_IF]++;
+ }
}
if (arg == phi) {
#define MAX_PHASE 2
/**
- * For an explanation of these values see phi_copystat_dump_pretty
+ * For an explanation of these values see the code of copystat_dump_pretty
*/
enum vals_t {
I_ALL_NODES = 0,
/* copy instructions */
I_COPIES_MAX, /* max number of copies possible */
- I_COPIES_IF, /* number of copies inevitable due to root-arg-interf */
I_COPIES_INIT, /* !external set! number of copies in initial allocation */
I_COPIES_HEUR, /* !external set! number of copies after heuristic */
I_COPIES_OPT, /* !external set! number of copies after ilp */
+ I_COPIES_IF, /* number of copies inevitable due to root-arg-interf */
ASIZE
};
//TODO be_ssa_destruction(&session, chordal_env);
be_ra_chordal_done(chordal_env);
}
- copystat_dump(irg);
+ copystat_dump_pretty(irg);
be_numbering_done(irg);
}
}
#include "sp_matrix.h"
#include "ilcplex/cplex.h"
-#define LOGFILE stdout
+#undef LOGFILE //stdout
#define TIME_LIMIT 30 /* in sec. 0 for none */
static char cpx_cst_encoding[4] = {'?', 'E', 'L', 'G'};
chk_cpx_err(cpx);
CPXchgobjsen(cpx->env, cpx->prob, (lpp->opt_type == minimize)?1:-1);
chk_cpx_err(cpx);
+#ifdef LOGFILE
if (CPXsetlogfile(cpx->env, LOGFILE))
assert(0 && "Could not set logfile");
+#endif
return cpx;
}