be: Replace be_put_allocatable_regs() by be_get_allocatable_regs().
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 19 Dec 2012 13:07:22 +0000 (14:07 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 19 Dec 2012 16:58:39 +0000 (17:58 +0100)
ir/be/be_t.h
ir/be/beabi.c
ir/be/bechordal_main.c

index 38c9391..af65fa8 100644 (file)
 #ifndef FIRM_BE_BE_T_H
 #define FIRM_BE_BE_T_H
 
 #ifndef FIRM_BE_BE_T_H
 #define FIRM_BE_BE_T_H
 
+#include <assert.h>
+
 #include "be.h"
 #include "be_types.h"
 #include "be.h"
 #include "be_types.h"
-#include "bitset.h"
 #include "firm_types.h"
 #include "pmap.h"
 #include "timing.h"
 #include "firm_types.h"
 #include "pmap.h"
 #include "timing.h"
@@ -70,9 +71,6 @@ extern asm_constraint_flags_t asm_constraint_flags[256];
 
 void be_init_default_asm_constraint_flags(void);
 
 
 void be_init_default_asm_constraint_flags(void);
 
-void be_put_allocatable_regs(const ir_graph *irg,
-                             const arch_register_class_t *cls, bitset_t *bs);
-
 void be_get_allocatable_regs(ir_graph const *irg, arch_register_class_t const *cls, unsigned *raw_bitset);
 
 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
 void be_get_allocatable_regs(ir_graph const *irg, arch_register_class_t const *cls, unsigned *raw_bitset);
 
 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
index 377b675..f9d09cb 100644 (file)
@@ -1803,28 +1803,12 @@ void be_abi_introduce(ir_graph *irg)
        pmap_destroy(env.regs);
 }
 
        pmap_destroy(env.regs);
 }
 
-void be_put_allocatable_regs(const ir_graph *irg,
-                             const arch_register_class_t *cls, bitset_t *bs)
-{
-       be_irg_t *birg             = be_birg_from_irg(irg);
-       unsigned *allocatable_regs = birg->allocatable_regs;
-       unsigned  i;
-
-       assert(bitset_size(bs) == cls->n_regs);
-       bitset_clear_all(bs);
-       for (i = 0; i < cls->n_regs; ++i) {
-               const arch_register_t *reg = &cls->regs[i];
-               if (rbitset_is_set(allocatable_regs, reg->global_index))
-                       bitset_set(bs, i);
-       }
-}
-
 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
                                    const arch_register_class_t *cls)
 {
 unsigned be_get_n_allocatable_regs(const ir_graph *irg,
                                    const arch_register_class_t *cls)
 {
-       bitset_t *bs = bitset_alloca(cls->n_regs);
-       be_put_allocatable_regs(irg, cls, bs);
-       return bitset_popcount(bs);
+       unsigned *const bs = rbitset_alloca(cls->n_regs);
+       be_get_allocatable_regs(irg, cls, bs);
+       return rbitset_popcount(bs, cls->n_regs);
 }
 
 void be_get_allocatable_regs(ir_graph const *const irg, arch_register_class_t const *const cls, unsigned *const raw_bitset)
 }
 
 void be_get_allocatable_regs(ir_graph const *const irg, arch_register_class_t const *const cls, unsigned *const raw_bitset)
index 59912d0..1753a2d 100644 (file)
@@ -220,7 +220,7 @@ static void pre_spill(be_chordal_env_t *const chordal_env, arch_register_class_t
        be_assure_live_chk(irg);
 
        /* put all ignore registers into the ignore register set. */
        be_assure_live_chk(irg);
 
        /* put all ignore registers into the ignore register set. */
-       be_put_allocatable_regs(irg, cls, chordal_env->allocatable_regs);
+       be_get_allocatable_regs(irg, cls, chordal_env->allocatable_regs->data);
 
        be_timer_push(T_RA_CONSTR);
        be_pre_spill_prepare_constr(irg, cls);
 
        be_timer_push(T_RA_CONSTR);
        be_pre_spill_prepare_constr(irg, cls);