Commit 59b137d6 authored by Matthias Braun's avatar Matthias Braun
Browse files

ask abi about ignore regs

parent 88ea6598
......@@ -424,15 +424,6 @@ extern int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn,
*/
extern void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls, bitset_t *bs);
/**
* Return the number of registers in a register class which should not be
* ignored by the register allocator.
* @param env The architecture environment.
* @param cls The register class to consider
* @return The number of non-ignore registers in the register class
*/
extern int arch_count_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls);
/**
* Check, if a register is assignable to an operand of a node.
* @param env The architecture environment.
......
......@@ -14,6 +14,7 @@
#include "bechordal_t.h"
#include "bespill.h"
#include "belive_t.h"
#include "beabi.h"
#include "irgwalk.h"
#include "besched.h"
#include "beutil.h"
......@@ -452,6 +453,13 @@ static int reduce_register_pressure_in_loop(morgan_env_t *env, const ir_loop *lo
return outer_spills_needed;
}
static int count_available_registers(be_abi_irg_t *abi, const arch_register_class_t *cls)
{
bitset_t* bs = bitset_alloca(cls->n_regs);
be_abi_put_ignore_regs(abi, cls, bs);
return bitset_popcnt(bs);
}
void be_spill_morgan(be_chordal_env_t *chordal_env) {
morgan_env_t env;
......@@ -467,7 +475,7 @@ void be_spill_morgan(be_chordal_env_t *chordal_env) {
obstack_init(&env.obst);
env.registers_available = arch_count_non_ignore_regs(env.arch, env.cls);
env.registers_available = count_available_registers(chordal_env->birg->abi, chordal_env->cls);
env.loop_attr_set = new_set(loop_attr_cmp, 5);
env.block_attr_set = new_set(block_attr_cmp, 20);
......
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