Interference matrix is now initialized faster
[libfirm] / ir / be / becopystat.c
index 31c49b3..958ea67 100644 (file)
 #include "irnodeset.h"
 
 #include "bechordal_t.h"
-#include "benode_t.h"
+#include "benode.h"
 #include "beutil.h"
 #include "becopyopt_t.h"
 #include "becopystat.h"
-#include "beirg_t.h"
+#include "beirg.h"
 #include "bemodule.h"
 #include "beintlive_t.h"
 
@@ -244,7 +244,7 @@ static void stat_phi_node(be_chordal_env_t *chordal_env, ir_node *phi)
 static void stat_copy_node(be_chordal_env_t *chordal_env, ir_node *root) {
        curr_vals[I_CPY_CNT]++;
        curr_vals[I_COPIES_MAX]++;
-       if (values_interfere(chordal_env->birg, root, get_Perm_src(root))) {
+       if (be_values_interfere(chordal_env->birg->lv, root, get_Perm_src(root))) {
                curr_vals[I_COPIES_IF]++;
                assert(0 && "A Perm pair (in/out) should never interfere!");
        }
@@ -280,7 +280,7 @@ static void stat_phi_class(be_chordal_env_t *chordal_env, ir_node **pc) {
        curr_vals[I_CLS_IF_MAX] += size * (size - 1) / 2;
        for (if_free = 1, i = 0; i < size - 1; ++i)
                for (o = i + 1; o < size; ++o)
-                       if (values_interfere(chordal_env->birg, pc[i], pc[o])) {
+                       if (be_values_interfere(chordal_env->birg->lv, pc[i], pc[o])) {
                                if_free = 0;
                                curr_vals[I_CLS_IF_CNT]++;
                        }
@@ -304,18 +304,18 @@ static void copystat_collect_cls(be_chordal_env_t *cenv) {
        all_phi_classes = get_all_phi_classes(pc_obj);
 
        foreach_ir_nodeset(all_phi_nodes, n, iter) {
-               if (arch_get_irn_reg_class(n, -1) == cenv->cls)
+               if (arch_get_irn_reg_class_out(n) == cenv->cls)
                        stat_phi_node(cenv, n);
        }
 
        foreach_ir_nodeset(all_copy_nodes, n, iter) {
-               if (arch_get_irn_reg_class(n, -1) == cenv->cls)
+               if (arch_get_irn_reg_class_out(n) == cenv->cls)
                        stat_copy_node(cenv, n);
        }
 
        foreach_pset(all_phi_classes, pc) {
                ir_node *member = pc[0];
-               if (arch_get_irn_reg_class(member, -1) == cenv->cls)
+               if (arch_get_irn_reg_class_out(member) == cenv->cls)
                        stat_phi_class(cenv, pc);
        }
 
@@ -370,7 +370,7 @@ void copystat_dump(ir_graph *irg) {
        char buf[1024];
        FILE *out;
 
-       snprintf(buf, sizeof(buf), "%s__%s", get_irp_prog_name(), get_entity_name(get_irg_entity(irg)));
+       snprintf(buf, sizeof(buf), "%s__%s", get_irp_name(), get_entity_name(get_irg_entity(irg)));
        buf[sizeof(buf) - 1] = '\0';
        out = be_ffopen(buf, "stat", "wt");
 
@@ -394,7 +394,7 @@ void copystat_dump_pretty(ir_graph *irg) {
        char buf[1024];
        FILE *out;
 
-       snprintf(buf, sizeof(buf), "%s__%s", get_irp_prog_name(), get_entity_name(get_irg_entity(irg)));
+       snprintf(buf, sizeof(buf), "%s__%s", get_irp_name(), get_entity_name(get_irg_entity(irg)));
        buf[sizeof(buf) - 1] = '\0';
        out = be_ffopen(buf, "pstat", "wt");
 
@@ -449,7 +449,7 @@ typedef struct color_saver {
 
 static void save_load(ir_node *irn, void *env) {
        color_save_t *saver = env;
-       if (saver->chordal_env->cls == arch_get_irn_reg_class(irn, -1)) {
+       if (saver->chordal_env->cls == arch_get_irn_reg_class_out(irn)) {
                if (saver->flag == 0) { /* save */
                        const arch_register_t *reg = arch_get_irn_register(irn);
                        pmap_insert(saver->saved_colors, irn, (void *) reg);