Added setDebug() to heur 3
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Tue, 29 Aug 2006 09:35:12 +0000 (09:35 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Tue, 29 Aug 2006 09:35:12 +0000 (09:35 +0000)
ir/be/arm/bearch_arm.c
ir/be/becopyheur3.c
ir/be/bejavacoal.c
ir/be/bejavacoal.h
ir/be/benode.c

index d4096a4..8df3aac 100644 (file)
@@ -941,7 +941,8 @@ static void arm_abi_epilogue(void *self, ir_node *bl, ir_node **mem, pmap *reg_m
 
 //     TODO: Activate Omit fp in epilogue
        if(env->flags.try_omit_fp) {
-               curr_sp = be_new_IncSP(env->isa->sp, env->irg, bl, curr_sp, *mem, BE_STACK_FRAME_SIZE_SHRINK);
+               curr_sp = be_new_IncSP(env->isa->sp, env->irg, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK);
+               add_irn_dep(curr_sp, *mem);
 
                curr_lr = be_new_CopyKeep_single(&arm_reg_classes[CLASS_arm_gp], env->irg, bl, curr_lr, curr_sp, get_irn_mode(curr_lr));
                be_node_set_reg_class(curr_lr, 1, &arm_reg_classes[CLASS_arm_gp]);
index 87db153..40dafc5 100644 (file)
@@ -98,6 +98,7 @@ int co_solve_heuristic_java(copy_opt_t *co)
        bitset_t *nodes = bitset_malloc(get_irg_last_idx(co->irg));
        unsigned n_regs = co->cenv->cls->n_regs;
 
+       char dbg[256];
        unsigned i, j, curr_idx;
        int *col_map;
        int *inv_col_map;
@@ -155,6 +156,8 @@ int co_solve_heuristic_java(copy_opt_t *co)
                if(bitset_is_set(nodes, n_idx)) {
                        affinity_node_t *an = get_affinity_info(co, n);
 
+                       ir_snprintf(dbg, sizeof(dbg), "%+F", n);
+                       be_java_coal_set_debug(coal, t_idx, dbg);
                        be_java_coal_set_color(coal, t_idx, col_map[arch_get_irn_register(co->aenv, n)->index]);
                        set_admissible_regs(coal, co, n, t_idx, col_map);
                        be_ifg_foreach_neighbour(ifg, neigh_it, n, m) {
index 03ccf30..e9fd618 100644 (file)
@@ -226,6 +226,7 @@ enum {
        mth_add_int_edge,
        mth_add_aff_edge,
        mth_set_color,
+       mth_set_debug,
        mth_get_color,
        mth_forbid_color,
        mth_coalesce,
@@ -243,6 +244,7 @@ static const struct _mth_info_t mthis[mth_last] = {
        { "addIntEdge",  "(II)V"                   }, /* public void addIntEdge(int, int); */
        { "addAffEdge",  "(III)V"                  }, /* public void addAffEdge(int, int, int); */
        { "setColor",    "(II)V"                   }, /* public void setColor(int, int); */
+       { "setDebug",    "(ILjava/lang/String;)V"  }, /* public void setDebug(int, String); */
        { "getColor",    "(I)I"                    }, /* public int getColor(int); */
        { "forbidColor", "(II)V"                   }, /* public void forbidColor(int, int); */
        { "coalesce",    "()V"                     }, /* public void coalesce(); */
@@ -356,6 +358,18 @@ void be_java_coal_set_color(be_java_coal_t *c, int n, int col)
        jc_call_void(c, mth_set_color, (jint) n, (jint) col);
 }
 
+void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg)
+{
+       JNIEnv *jni   = c->env->jni;
+       jmethodID mid = c->mth_ids[mth_set_debug];
+       jstring str;
+
+       str = (*jni)->NewStringUTF(jni, dbg);
+       CHECK(c->env);
+       (*jni)->CallVoidMethod(jni, c->obj, mid, (jint) n, str);
+       CHECK(c->env);
+}
+
 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col)
 {
        jc_call_void(c, mth_forbid_color, (jint) n, (jint) col);
@@ -412,6 +426,11 @@ void be_java_coal_set_color(be_java_coal_t *c, int n, int col)
        assert(0 && "use --enable-jvm");
 }
 
+void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg)
+{
+       assert(0 && "use --enable-jvm");
+}
+
 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col)
 {
        assert(0 && "use --enable-jvm");
index 28d1305..eb94c90 100644 (file)
@@ -41,6 +41,13 @@ void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
  */
 void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
 
+/**
+ * Set debug information for a node.
+ * @param n The node.
+ * @param dbg Some string copied to Java.
+ */
+void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
+
 /**
  * Forbid a color for a node.
  * Afterwards, the node may not be assigned that color.
index b3b7b88..992daed 100644 (file)
@@ -602,9 +602,8 @@ ir_node *be_new_SetSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_
 
        /* Set output constraint to stack register. */
        be_set_constr_single_reg(irn, OUT_POS(0), sp);
-       be_node_set_reg_class(irn, 1, sp->reg_class);
-       be_node_set_reg_class(irn, 2, sp->reg_class);
-       be_node_set_irn_reg(NULL, irn, sp);
+       be_node_set_reg_class(irn, be_pos_AddSP_size, sp->reg_class);
+       be_node_set_reg_class(irn, be_pos_AddSP_old_sp, sp->reg_class);
 
        return irn;
 }