Bugfixes. DBG per irg. Dump nothing is default.
authorDaniel Grund <grund@cs.uni-saarland.de>
Tue, 14 Jun 2005 13:00:54 +0000 (13:00 +0000)
committerDaniel Grund <grund@cs.uni-saarland.de>
Tue, 14 Jun 2005 13:00:54 +0000 (13:00 +0000)
ir/be/bechordal.c
ir/be/becopyheur.c
ir/be/becopyilp.c
ir/be/becopyopt.c
ir/be/becopyopt.h
ir/be/becopyoptmain.c
ir/be/becopyoptmain.h
ir/be/becopystat.c
ir/be/becopystat.h
ir/be/bemain.c
ir/be/lpp_local.c

index eb07a71..567fbca 100644 (file)
@@ -39,7 +39,7 @@
 
 #define NO_COLOR (-1)
 
-#define DUMP_INTERVALS
+#undef DUMP_INTERVALS
 #undef DUMP_PRESSURE
 #undef DUMP_IFG
 
index 4621ff1..022fe85 100644 (file)
@@ -553,7 +553,9 @@ void co_heur_opt(copy_opt_t *co) {
        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)
index e1dcabe..c2290ee 100644 (file)
@@ -493,7 +493,7 @@ void co_ilp_opt(copy_opt_t *co) {
 
        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);
 
index e256cac..5410fe6 100644 (file)
@@ -103,7 +103,7 @@ conflict_found:
 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;
@@ -128,7 +128,7 @@ static void co_append_unit(copy_opt_t *co, ir_node *root) {
                        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;
@@ -182,9 +182,11 @@ copy_opt_t *new_copy_opt(be_chordal_env_t *chordal_env) {
        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);
@@ -216,9 +218,12 @@ int co_get_copy_count(const copy_opt_t *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;
 }
index 4ad0411..cf78ef1 100644 (file)
 #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
 
index 73b6ebf..ee0954e 100644 (file)
@@ -24,7 +24,7 @@
 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);
 }
 
index 832a57d..9bf9c0b 100644 (file)
@@ -8,8 +8,6 @@
  * - phi coalescing
  * - register-constrained nodes
  *
- * Checker included.
- * By request some statistics are collected too.
  */
 
 #ifndef _BECOPYOPTMAIN_H
index 9f8b64d..52a5c5c 100644 (file)
@@ -9,30 +9,42 @@
 #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();
 }
 
 /**
@@ -76,8 +88,10 @@ static void stat_phi_node(be_chordal_env_t *chordal_env, ir_node *phi) {
 
                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) {
index c5346e2..e033fb3 100644 (file)
@@ -17,7 +17,7 @@
 #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,
@@ -50,10 +50,10 @@ enum vals_t {
 
        /* 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
 };
index aab1b0f..67dbc95 100644 (file)
@@ -131,7 +131,7 @@ static void be_main_loop(void)
                        //TODO be_ssa_destruction(&session, chordal_env);
                        be_ra_chordal_done(chordal_env);
                }
-               copystat_dump(irg);
+               copystat_dump_pretty(irg);
            be_numbering_done(irg);
        }
 }
index 8639569..1b27e44 100644 (file)
@@ -21,7 +21,7 @@
 #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'};
@@ -54,8 +54,10 @@ static cpx_t *new_cpx(lpp_t *lpp) {
        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;
 }