typedef struct be_pbqp_alloc_env_t {
pbqp *pbqp_inst; /**< PBQP instance for register allocation */
ir_graph *irg; /**< The graph under examination. */
- const arch_register_class_t *cls; /**< Current processed register class */
+ const arch_register_class_t *cls; /**< Current processed register class */
be_lv_t *lv;
- bitset_t *ignored_regs;
+ bitset_t *allocatable_regs;
pbqp_matrix *ife_matrix_template;
pbqp_matrix *aff_matrix_template;
plist_t *rpeo;
{
const arch_register_class_t *cls = pbqp_alloc_env->cls;
pbqp *pbqp_inst = pbqp_alloc_env->pbqp_inst;
- bitset_t *ignored_regs = pbqp_alloc_env->ignored_regs;
+ bitset_t *allocatable_regs = pbqp_alloc_env->allocatable_regs;
unsigned colors_n = arch_register_class_n_regs(cls);
unsigned cntConstrains = 0;
/* set costs depending on register constrains */
unsigned idx;
for (idx = 0; idx < colors_n; idx++) {
- if (bitset_is_set(ignored_regs, idx) || !arch_reg_out_is_allocatable(irn, arch_register_for_index(cls, idx))) {
+ if (!bitset_is_set(allocatable_regs, idx) || !arch_reg_out_is_allocatable(irn, arch_register_for_index(cls, idx))) {
/* constrained */
vector_set(costs_vector, idx, INF_COSTS);
cntConstrains++;
static void create_pbqp_coloring_instance(ir_node *block, void *data)
{
- be_pbqp_alloc_env_t *pbqp_alloc_env = data;
- be_lv_t *lv = pbqp_alloc_env->lv;
- const arch_register_class_t *cls = pbqp_alloc_env->cls;
+ be_pbqp_alloc_env_t *pbqp_alloc_env = data;
+ be_lv_t *lv = pbqp_alloc_env->lv;
+ const arch_register_class_t *cls = pbqp_alloc_env->cls;
plist_t *rpeo = pbqp_alloc_env->rpeo;
pbqp *pbqp_inst = pbqp_alloc_env->pbqp_inst;
plist_t *temp_list = plist_new();
int *assignment = ALLOCAN(int, cls->n_regs);
#else
unsigned *restr_nodes = pbqp_alloc_env->restr_nodes;
- pqueue_t *restr_nodes_queue = new_pqueue();
- pqueue_t *queue = new_pqueue();
- plist_t *sorted_list = plist_new();
+ pqueue_t *restr_nodes_queue = new_pqueue();
+ pqueue_t *queue = new_pqueue();
+ plist_t *sorted_list = plist_new();
ir_node *last_element = NULL;
#endif
* start handling constraints from there.
*/
for (irn = sched_first(block); !sched_is_end(irn);) {
- int silent_old = silent; /* store old silent value */
+ int silent_old = silent; /* store old silent value */
if (be_is_Barrier(irn))
- silent = !silent; /* toggle silent flag */
+ silent = !silent; /* toggle silent flag */
be_insn_t *insn = chordal_scan_insn(env, irn);
irn = insn->next_insn;
/* initialize pbqp allocation data structure */
- pbqp_alloc_env.pbqp_inst = alloc_pbqp(get_irg_last_idx(irg)); /* initialize pbqp instance */
- pbqp_alloc_env.cls = cls;
- pbqp_alloc_env.irg = irg;
- pbqp_alloc_env.lv = lv;
- pbqp_alloc_env.ignored_regs = bitset_malloc(colors_n);
- pbqp_alloc_env.rpeo = plist_new();
- pbqp_alloc_env.restr_nodes = XMALLOCNZ(unsigned, get_irg_last_idx(irg));
- pbqp_alloc_env.ife_edge_num = XMALLOCNZ(unsigned, get_irg_last_idx(irg));
- pbqp_alloc_env.env = env;
- be_put_ignore_regs(irg, cls, pbqp_alloc_env.ignored_regs); /* get ignored registers */
+ pbqp_alloc_env.pbqp_inst = alloc_pbqp(get_irg_last_idx(irg)); /* initialize pbqp instance */
+ pbqp_alloc_env.cls = cls;
+ pbqp_alloc_env.irg = irg;
+ pbqp_alloc_env.lv = lv;
+ pbqp_alloc_env.allocatable_regs = bitset_malloc(colors_n);
+ pbqp_alloc_env.rpeo = plist_new();
+ pbqp_alloc_env.restr_nodes = XMALLOCNZ(unsigned, get_irg_last_idx(irg));
+ pbqp_alloc_env.ife_edge_num = XMALLOCNZ(unsigned, get_irg_last_idx(irg));
+ pbqp_alloc_env.env = env;
+ be_put_allocatable_regs(irg, cls, pbqp_alloc_env.allocatable_regs);
/* create costs matrix template for interference edges */
#if PRINT_RPEO
plist_element_t *elements;
foreach_plist(pbqp_alloc_env.rpeo, elements) {
- pbqp_node *node = elements->data;
+ pbqp_node *node = elements->data;
printf(" %d(%lu);", node->index, get_idx_irn(irg, node->index)->node_nr);
}
printf("\n");
#if KAPS_DUMP
fclose(file_before);
#endif
- bitset_free(pbqp_alloc_env.ignored_regs);
+ bitset_free(pbqp_alloc_env.allocatable_regs);
free_pbqp(pbqp_alloc_env.pbqp_inst);
plist_free(pbqp_alloc_env.rpeo);
xfree(pbqp_alloc_env.restr_nodes);