Commit b18d422d authored by Matthias Braun's avatar Matthias Braun
Browse files

small optimisation (avoid some arch_irn_consider_in_regalloc

[r26531]
parent ed19abee
...@@ -160,6 +160,11 @@ static allocation_info_t *get_allocation_info(ir_node *node) ...@@ -160,6 +160,11 @@ static allocation_info_t *get_allocation_info(ir_node *node)
return info; return info;
} }
static allocation_info_t *try_get_allocation_info(const ir_node *node)
{
return (allocation_info_t*) get_irn_link(node);
}
/** /**
* Get allocation information for a basic block * Get allocation information for a basic block
*/ */
...@@ -1105,12 +1110,11 @@ static void rewire_inputs(ir_node *node) ...@@ -1105,12 +1110,11 @@ static void rewire_inputs(ir_node *node)
for (i = 0; i < arity; ++i) { for (i = 0; i < arity; ++i) {
ir_node *op = get_irn_n(node, i); ir_node *op = get_irn_n(node, i);
allocation_info_t *info; allocation_info_t *info = try_get_allocation_info(op);
if (!arch_irn_consider_in_reg_alloc(cls, op)) if (info == NULL)
continue; continue;
info = get_allocation_info(op);
info = get_allocation_info(info->original_value); info = get_allocation_info(info->original_value);
if (info->current_value != op) { if (info->current_value != op) {
set_irn_n(node, i, info->current_value); set_irn_n(node, i, info->current_value);
...@@ -1599,7 +1603,6 @@ static void allocate_coalesce_block(ir_node *block, void *data) ...@@ -1599,7 +1603,6 @@ static void allocate_coalesce_block(ir_node *block, void *data)
{ {
int i; int i;
ir_nodeset_t live_nodes; ir_nodeset_t live_nodes;
ir_nodeset_iterator_t iter;
ir_node *node; ir_node *node;
int n_preds; int n_preds;
block_info_t *block_info; block_info_t *block_info;
...@@ -1665,17 +1668,19 @@ static void allocate_coalesce_block(ir_node *block, void *data) ...@@ -1665,17 +1668,19 @@ static void allocate_coalesce_block(ir_node *block, void *data)
ir_mode *mode = get_irn_mode(node); ir_mode *mode = get_irn_mode(node);
const arch_register_req_t *req = get_default_req_current_cls(); const arch_register_req_t *req = get_default_req_current_cls();
ir_node *phi; ir_node *phi;
int i;
phi = new_r_Phi(block, n_preds, phi_ins, mode); phi = new_r_Phi(block, n_preds, phi_ins, mode);
be_set_phi_reg_req(phi, req); be_set_phi_reg_req(phi, req);
DB((dbg, LEVEL_3, "Create Phi %+F (for %+F) -", phi, node)); DB((dbg, LEVEL_3, "Create Phi %+F (for %+F) -", phi, node));
#ifdef DEBUG_libfirm #ifdef DEBUG_libfirm
for (i = 0; i < n_preds; ++i) { {
DB((dbg, LEVEL_3, " %+F", phi_ins[i])); int i;
for (i = 0; i < n_preds; ++i) {
DB((dbg, LEVEL_3, " %+F", phi_ins[i]));
}
DB((dbg, LEVEL_3, "\n"));
} }
DB((dbg, LEVEL_3, "\n"));
#endif #endif
mark_as_copy_of(phi, node); mark_as_copy_of(phi, node);
sched_add_after(block, phi); sched_add_after(block, phi);
...@@ -1708,9 +1713,12 @@ static void allocate_coalesce_block(ir_node *block, void *data) ...@@ -1708,9 +1713,12 @@ static void allocate_coalesce_block(ir_node *block, void *data)
/* all live-ins must have a register */ /* all live-ins must have a register */
#ifdef DEBUG_libfirm #ifdef DEBUG_libfirm
foreach_ir_nodeset(&live_nodes, node, iter) { {
const arch_register_t *reg = arch_get_irn_register(node); ir_nodeset_iterator_t iter;
assert(reg != NULL); foreach_ir_nodeset(&live_nodes, node, iter) {
const arch_register_t *reg = arch_get_irn_register(node);
assert(reg != NULL);
}
} }
#endif #endif
...@@ -1914,7 +1922,6 @@ static void be_straight_alloc_cls(void) ...@@ -1914,7 +1922,6 @@ static void be_straight_alloc_cls(void)
lv = be_assure_liveness(birg); lv = be_assure_liveness(birg);
be_liveness_assure_sets(lv); be_liveness_assure_sets(lv);
be_liveness_assure_chk(lv);
ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK); ir_reserve_resources(irg, IR_RESOURCE_IRN_LINK);
......
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