*/
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.
#include "bechordal_t.h"
#include "bespill.h"
#include "belive_t.h"
+#include "beabi.h"
#include "irgwalk.h"
#include "besched.h"
#include "beutil.h"
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;
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);