Commit d71dd461 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Replace be_put_allocatable_regs() by be_get_allocatable_regs().

parent 70b88494
......@@ -11,9 +11,10 @@
#ifndef FIRM_BE_BE_T_H
#define FIRM_BE_BE_T_H
#include <assert.h>
#include "be.h"
#include "be_types.h"
#include "bitset.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_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,
......
......@@ -1803,28 +1803,12 @@ void be_abi_introduce(ir_graph *irg)
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)
{
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)
......
......@@ -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_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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment