Initial commit of morgans spilling algorithm (spill unused values that live through
[libfirm] / ir / be / bearch.c
index f12ed01..f69e8b2 100644 (file)
@@ -167,6 +167,19 @@ void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t
        }
 }
 
+int arch_count_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls)
+{
+       int i;
+       int result = 0;
+
+       for(i = 0; i < cls->n_regs; ++i) {
+               if(!arch_register_type_is(&cls->regs[i], ignore))
+                       result++;
+       }
+
+       return result;
+}
+
 int arch_is_register_operand(const arch_env_t *env,
     const ir_node *irn, int pos)
 {