removed unitialized used vartiable
[libfirm] / ir / be / becopyheur.c
index 7f24bcc..886b45e 100644 (file)
 #include "config.h"
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
 #include "debug.h"
 #include "xmalloc.h"
 #include "becopyopt_t.h"
 #include "becopystat.h"
 #include "benodesets.h"
 #include "bitset.h"
+#include "raw_bitset.h"
+#include "xmalloc.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
@@ -74,6 +69,14 @@ typedef struct _qnode_t {
 
 static pset *pinned_global;                    /**< optimized nodes should not be altered any more */
 
+static INLINE int nodes_interfere(const be_chordal_env_t *env, const ir_node *a, const ir_node *b)
+{
+       if(env->ifg)
+               return be_ifg_connected(env->ifg, a, b);
+       else
+               return values_interfere(env->birg->lv, a, b);
+}
+
 static int set_cmp_conflict_t(const void *x, const void *y, size_t size) {
        const conflict_t *xx = x;
        const conflict_t *yy = y;
@@ -243,7 +246,7 @@ static ir_node *qnode_color_irn(const qnode_t *qn, ir_node *irn, int col, const
         */
        if (irn != trigger) {
                bitset_t *free_cols = bitset_alloca(cls->n_regs);
-               arch_register_req_t req;
+               const arch_register_req_t *req;
                ir_node *curr;
                int free_col;
 
@@ -252,10 +255,10 @@ static ir_node *qnode_color_irn(const qnode_t *qn, ir_node *irn, int col, const
                bitset_flip_all(free_cols);
 
                /* Exclude colors not assignable to the irn */
-               arch_get_register_req(arch_env, &req, irn, -1);
-               if (arch_register_req_is(&req, limited)) {
+               req = arch_get_register_req(arch_env, irn, -1);
+               if (arch_register_req_is(req, limited)) {
                        bitset_t *limited = bitset_alloca(cls->n_regs);
-                       req.limited(req.limited_env, limited);
+                       rbitset_copy_to_bitset(req->limited, limited);
                        bitset_and(free_cols, limited);
                }