remove return values from graph transformations
[libfirm] / ir / be / bepbqpcoloring.c
index 8d4f3dc..bfb819c 100644 (file)
@@ -22,7 +22,6 @@
  * @brief       PBQP based register allocation.
  * @author      Thomas Bersch
  * @date        27.11.2009
- * @version     $Id: bechordal.c 26750 2009-11-27 09:37:43Z bersch $
  */
 
 /* miscellaneous includes */
@@ -36,9 +35,9 @@
 #include "iredges_t.h"
 #include "irprintf.h"
 #include "irgwalk.h"
+#include "irtools.h"
 #include "time.h"
-
-/* libfirm/ir/adt includes */
+#include "execfreq.h"
 #include "bipartite.h"
 
 /* libfirm/ir/be includes */
@@ -155,7 +154,10 @@ static void create_pbqp_node(be_pbqp_alloc_env_t *pbqp_alloc_env, ir_node *irn)
        /* set costs depending on register constrains */
        unsigned idx;
        for (idx = 0; idx < colors_n; idx++) {
-               if (!bitset_is_set(allocatable_regs, idx) || !arch_reg_out_is_allocatable(irn, arch_register_for_index(cls, idx))) {
+               const arch_register_req_t *req = arch_get_irn_register_req(irn);
+               const arch_register_t     *reg = arch_register_for_index(cls, idx);
+               if (!bitset_is_set(allocatable_regs, idx)
+                   || !arch_reg_is_allocatable(req, reg)) {
                        /* constrained */
                        vector_set(costs_vector, idx, INF_COSTS);
                        cntConstrains++;
@@ -259,7 +261,7 @@ static void create_affinity_edges(ir_node *irn, void *env)
 {
        be_pbqp_alloc_env_t         *pbqp_alloc_env = (be_pbqp_alloc_env_t*)env;
        const arch_register_class_t *cls            = pbqp_alloc_env->cls;
-       const arch_register_req_t   *req            = arch_get_register_req_out(irn);
+       const arch_register_req_t   *req            = arch_get_irn_register_req(irn);
        unsigned                     pos;
        unsigned                     max;
 
@@ -633,9 +635,8 @@ static void be_pbqp_coloring(be_chordal_env_t *env)
 
        printf("#### ----- === Allocating registers of %s (%s) ===\n", cls->name, get_entity_name(get_irg_entity(irg)));
 #endif
-       lv = be_assure_liveness(irg);
-       be_liveness_assure_sets(lv);
-       be_liveness_assure_chk(lv);
+       be_assure_live_sets(irg);
+       lv = be_get_irg_liveness(irg);
 
        /* insert perms */
        assure_doms(irg);
@@ -785,7 +786,7 @@ static void be_pbqp_coloring(be_chordal_env_t *env)
 /**
  * Initializes this module.
  */
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pbqp_coloring);
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_pbqp_coloring)
 void be_init_pbqp_coloring(void)
 {
        lc_opt_entry_t *be_grp       = lc_opt_get_grp(firm_opt_get_root(), "be");