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

put irg link directly into node attributs

The previous approach put the irg link into the block attributes, so
while saving memory an extra indirection was necessary. Some testing
with valgrind massif+callgrind revealed that a direct link increses peak
memory usage by ~1% while also increasing runtime by ~1%. More
importantly the code gets a bit simpler and some strange corner cases can be
removed with the direct link.
parent 512cb109
...@@ -262,8 +262,6 @@ FIRM_API void mark_Block_block_visited(ir_node *node); ...@@ -262,8 +262,6 @@ FIRM_API void mark_Block_block_visited(ir_node *node);
/** Returns 1 if a block is marked as visited */ /** Returns 1 if a block is marked as visited */
FIRM_API int Block_block_visited(const ir_node *node); FIRM_API int Block_block_visited(const ir_node *node);
/** Returns the ir_graph this Block belongs to. */
FIRM_API ir_graph *get_Block_irg(const ir_node *block);
/** Returns the entity for a Block (creating it if necessary) */ /** Returns the entity for a Block (creating it if necessary) */
FIRM_API ir_entity *create_Block_entity(ir_node *block); FIRM_API ir_entity *create_Block_entity(ir_node *block);
/** Returns the head of the Phi list for this block. */ /** Returns the head of the Phi list for this block. */
......
...@@ -256,7 +256,7 @@ result_unknown_X: ...@@ -256,7 +256,7 @@ result_unknown_X:
} }
if (!reachable) { if (!reachable) {
ir_graph *const irg = get_Block_irg(irn); ir_graph *const irg = get_irn_irg(irn);
reachable = reachable =
irn == get_irg_start_block(irg) || irn == get_irg_start_block(irg) ||
irn == get_irg_end_block(irg); irn == get_irg_end_block(irg);
......
...@@ -84,7 +84,7 @@ ir_entity *create_float_const_entity(ir_graph *const irg, ...@@ -84,7 +84,7 @@ ir_entity *create_float_const_entity(ir_graph *const irg,
ir_node *create_float_const(dbg_info *dbgi, ir_node *block, ir_node *create_float_const(dbg_info *dbgi, ir_node *block,
ir_tarval *tv) ir_tarval *tv)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_mode *tv_mode = get_tarval_mode(tv); ir_mode *tv_mode = get_tarval_mode(tv);
ir_entity *entity = create_float_const_entity(irg, tv); ir_entity *entity = create_float_const_entity(irg, tv);
ir_node *nomem = get_irg_no_mem(irg); ir_node *nomem = get_irg_no_mem(irg);
......
...@@ -1332,7 +1332,7 @@ static ir_node *ints_to_double(dbg_info *dbgi, ir_node *block, ir_node *node0, ...@@ -1332,7 +1332,7 @@ static ir_node *ints_to_double(dbg_info *dbgi, ir_node *block, ir_node *node0,
/* the good way to do this would be to use the stm (store multiple) /* the good way to do this would be to use the stm (store multiple)
* instructions, since our input is nearly always 2 consecutive 32bit * instructions, since our input is nearly always 2 consecutive 32bit
* registers... */ * registers... */
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg); ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg); ir_node *nomem = get_irg_no_mem(irg);
ir_node *str0 = new_bd_arm_Str(dbgi, block, stack, node0, nomem, ir_node *str0 = new_bd_arm_Str(dbgi, block, stack, node0, nomem,
...@@ -1353,7 +1353,7 @@ static ir_node *ints_to_double(dbg_info *dbgi, ir_node *block, ir_node *node0, ...@@ -1353,7 +1353,7 @@ static ir_node *ints_to_double(dbg_info *dbgi, ir_node *block, ir_node *node0,
static ir_node *int_to_float(dbg_info *dbgi, ir_node *block, ir_node *node) static ir_node *int_to_float(dbg_info *dbgi, ir_node *block, ir_node *node)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg); ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg); ir_node *nomem = get_irg_no_mem(irg);
ir_node *str = new_bd_arm_Str(dbgi, block, stack, node, nomem, ir_node *str = new_bd_arm_Str(dbgi, block, stack, node, nomem,
...@@ -1369,7 +1369,7 @@ static ir_node *int_to_float(dbg_info *dbgi, ir_node *block, ir_node *node) ...@@ -1369,7 +1369,7 @@ static ir_node *int_to_float(dbg_info *dbgi, ir_node *block, ir_node *node)
static ir_node *float_to_int(dbg_info *dbgi, ir_node *block, ir_node *node) static ir_node *float_to_int(dbg_info *dbgi, ir_node *block, ir_node *node)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg); ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg); ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_F, ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_F,
...@@ -1386,7 +1386,7 @@ static ir_node *float_to_int(dbg_info *dbgi, ir_node *block, ir_node *node) ...@@ -1386,7 +1386,7 @@ static ir_node *float_to_int(dbg_info *dbgi, ir_node *block, ir_node *node)
static void double_to_ints(dbg_info *dbgi, ir_node *block, ir_node *node, static void double_to_ints(dbg_info *dbgi, ir_node *block, ir_node *node,
ir_node **out_value0, ir_node **out_value1) ir_node **out_value0, ir_node **out_value1)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg); ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg); ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_D, ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_D,
...@@ -1585,7 +1585,7 @@ static ir_node *gen_Proj_Proj_Start(ir_node *node) ...@@ -1585,7 +1585,7 @@ static ir_node *gen_Proj_Proj_Start(ir_node *node)
long pn = get_Proj_proj(node); long pn = get_Proj_proj(node);
ir_node *block = get_nodes_block(node); ir_node *block = get_nodes_block(node);
ir_node *new_block = be_transform_node(block); ir_node *new_block = be_transform_node(block);
ir_graph *irg = get_Block_irg(new_block); ir_graph *irg = get_irn_irg(new_block);
ir_node *args = get_Proj_pred(node); ir_node *args = get_Proj_pred(node);
ir_node *start = get_Proj_pred(args); ir_node *start = get_Proj_pred(args);
ir_node *new_start = be_transform_node(start); ir_node *new_start = be_transform_node(start);
......
...@@ -127,7 +127,7 @@ static void arm_prepare_graph(ir_graph *irg) ...@@ -127,7 +127,7 @@ static void arm_prepare_graph(ir_graph *irg)
static ir_node *arm_new_reload(ir_node *value, ir_node *spill, ir_node *before) static ir_node *arm_new_reload(ir_node *value, ir_node *spill, ir_node *before)
{ {
ir_node *block = get_block(before); ir_node *block = get_block(before);
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(before);
ir_node *frame = get_irg_frame(irg); ir_node *frame = get_irg_frame(irg);
ir_mode *mode = get_irn_mode(value); ir_mode *mode = get_irn_mode(value);
ir_node *load = new_bd_arm_Ldr(NULL, block, frame, spill, mode, NULL, ir_node *load = new_bd_arm_Ldr(NULL, block, frame, spill, mode, NULL,
...@@ -141,7 +141,7 @@ static ir_node *arm_new_reload(ir_node *value, ir_node *spill, ir_node *before) ...@@ -141,7 +141,7 @@ static ir_node *arm_new_reload(ir_node *value, ir_node *spill, ir_node *before)
static ir_node *arm_new_spill(ir_node *value, ir_node *after) static ir_node *arm_new_spill(ir_node *value, ir_node *after)
{ {
ir_node *block = get_block(after); ir_node *block = get_block(after);
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(after);
ir_node *frame = get_irg_frame(irg); ir_node *frame = get_irg_frame(irg);
ir_node *mem = get_irg_no_mem(irg); ir_node *mem = get_irg_no_mem(irg);
ir_mode *mode = get_irn_mode(value); ir_mode *mode = get_irn_mode(value);
......
...@@ -687,7 +687,7 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size, ...@@ -687,7 +687,7 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size,
return size; return size;
ir_mode *mode = get_irn_mode(size); ir_mode *mode = get_irn_mode(size);
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *mask = new_r_Const_long(irg, mode, stack_alignment - 1); ir_node *mask = new_r_Const_long(irg, mode, stack_alignment - 1);
size = new_rd_Add(dbg, block, size, mask, mode); size = new_rd_Add(dbg, block, size, mask, mode);
mask = new_r_Const_long(irg, mode, -(long)stack_alignment); mask = new_r_Const_long(irg, mode, -(long)stack_alignment);
...@@ -702,7 +702,7 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size, ...@@ -702,7 +702,7 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size,
static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp) static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp)
{ {
ir_node *block = get_nodes_block(alloc); ir_node *block = get_nodes_block(alloc);
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(alloc);
const arch_env_t *arch_env = be_get_irg_arch_env(irg); const arch_env_t *arch_env = be_get_irg_arch_env(irg);
ir_node *alloc_mem = NULL; ir_node *alloc_mem = NULL;
...@@ -1070,7 +1070,7 @@ static ir_node *create_be_return(be_abi_irg_t *const env, ir_node *const irn) ...@@ -1070,7 +1070,7 @@ static ir_node *create_be_return(be_abi_irg_t *const env, ir_node *const irn)
{ {
ir_node *const bl = get_nodes_block(irn); ir_node *const bl = get_nodes_block(irn);
be_abi_call_t *call = env->call; be_abi_call_t *call = env->call;
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(irn);
const arch_env_t *arch_env = be_get_irg_arch_env(irg); const arch_env_t *arch_env = be_get_irg_arch_env(irg);
/* get the valid stack node in this block. /* get the valid stack node in this block.
......
...@@ -148,7 +148,7 @@ static void remove_empty_block(ir_node *block) ...@@ -148,7 +148,7 @@ static void remove_empty_block(ir_node *block)
panic("Unexpected node %+F in block %+F with empty schedule", node, block); panic("Unexpected node %+F in block %+F with empty schedule", node, block);
} }
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
set_Block_cfgpred(block, 0, new_r_Bad(irg, mode_X)); set_Block_cfgpred(block, 0, new_r_Bad(irg, mode_X));
kill_node(jump); kill_node(jump);
blocks_removed = true; blocks_removed = true;
......
...@@ -415,7 +415,7 @@ static bool value_live_after(const ir_node *const value, ...@@ -415,7 +415,7 @@ static bool value_live_after(const ir_node *const value,
/* If value is live end in after's block it is /* If value is live end in after's block it is
* live at after's definition (value dominates after) */ * live at after's definition (value dominates after) */
const ir_node *const bb = get_nodes_block(after); const ir_node *const bb = get_nodes_block(after);
const ir_graph *const irg = get_Block_irg(bb); const ir_graph *const irg = get_irn_irg(after);
const be_lv_t *const lv = be_get_irg_liveness(irg); const be_lv_t *const lv = be_get_irg_liveness(irg);
if (be_is_live_end(lv, bb, value)) if (be_is_live_end(lv, bb, value))
return true; return true;
...@@ -504,7 +504,7 @@ bool be_memory_values_interfere(const ir_node *a, const ir_node *b) ...@@ -504,7 +504,7 @@ bool be_memory_values_interfere(const ir_node *a, const ir_node *b)
/* If a is live end in b's block it is /* If a is live end in b's block it is
* live at b's definition (a dominates b) */ * live at b's definition (a dominates b) */
const ir_node *const bb = get_nodes_block(b); const ir_node *const bb = get_nodes_block(b);
const ir_graph *const irg = get_Block_irg(bb); const ir_graph *const irg = get_irn_irg(b);
const be_lv_t *const lv = be_get_irg_liveness(irg); const be_lv_t *const lv = be_get_irg_liveness(irg);
if (be_is_live_end(lv, bb, a)) if (be_is_live_end(lv, bb, a))
return true; return true;
......
...@@ -59,7 +59,7 @@ static unsigned be_compute_block_pressure(ir_node *const block, arch_register_cl ...@@ -59,7 +59,7 @@ static unsigned be_compute_block_pressure(ir_node *const block, arch_register_cl
/* determine largest pressure with this block */ /* determine largest pressure with this block */
ir_nodeset_t live_nodes; ir_nodeset_t live_nodes;
ir_nodeset_init(&live_nodes); ir_nodeset_init(&live_nodes);
be_lv_t *const lv = be_get_irg_liveness(get_Block_irg(block)); be_lv_t *const lv = be_get_irg_liveness(get_irn_irg(block));
be_liveness_end_of_block(lv, cls, block, &live_nodes); be_liveness_end_of_block(lv, cls, block, &live_nodes);
unsigned max_live = (unsigned)ir_nodeset_size(&live_nodes); unsigned max_live = (unsigned)ir_nodeset_size(&live_nodes);
......
...@@ -186,7 +186,7 @@ static void add_register_req_in(ir_node *node, const arch_register_req_t *req) ...@@ -186,7 +186,7 @@ static void add_register_req_in(ir_node *node, const arch_register_req_t *req)
ir_node *be_new_Perm(arch_register_class_t const *const cls, ir_node *const block, int const n, ir_node *const *const in) ir_node *be_new_Perm(arch_register_class_t const *const cls, ir_node *const block, int const n, ir_node *const *const in)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *irn = new_ir_node(NULL, irg, block, op_be_Perm, mode_T, n, in); ir_node *irn = new_ir_node(NULL, irg, block, op_be_Perm, mode_T, n, in);
init_node_attr(irn, n, n, arch_irn_flags_none); init_node_attr(irn, n, n, arch_irn_flags_none);
be_node_attr_t *attr = (be_node_attr_t*)get_irn_generic_attr(irn); be_node_attr_t *attr = (be_node_attr_t*)get_irn_generic_attr(irn);
...@@ -237,7 +237,7 @@ void be_Perm_reduce(ir_node *perm, int new_size, int *map) ...@@ -237,7 +237,7 @@ void be_Perm_reduce(ir_node *perm, int new_size, int *map)
ir_node *be_new_MemPerm(ir_node *const block, int n, ir_node *const *const in) ir_node *be_new_MemPerm(ir_node *const block, int n, ir_node *const *const in)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
const arch_env_t *arch_env = be_get_irg_arch_env(irg); const arch_env_t *arch_env = be_get_irg_arch_env(irg);
ir_node *frame = get_irg_frame(irg); ir_node *frame = get_irg_frame(irg);
const arch_register_t *sp = arch_env->sp; const arch_register_t *sp = arch_env->sp;
...@@ -260,7 +260,7 @@ ir_node *be_new_MemPerm(ir_node *const block, int n, ir_node *const *const in) ...@@ -260,7 +260,7 @@ ir_node *be_new_MemPerm(ir_node *const block, int n, ir_node *const *const in)
ir_node *be_new_Copy(ir_node *bl, ir_node *op) ir_node *be_new_Copy(ir_node *bl, ir_node *op)
{ {
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
ir_node *in[] = { op }; ir_node *in[] = { op };
ir_node *res = new_ir_node(NULL, irg, bl, op_be_Copy, get_irn_mode(op), ir_node *res = new_ir_node(NULL, irg, bl, op_be_Copy, get_irn_mode(op),
ARRAY_SIZE(in), in); ARRAY_SIZE(in), in);
...@@ -290,7 +290,7 @@ ir_node *be_get_Copy_op(const ir_node *cpy) ...@@ -290,7 +290,7 @@ ir_node *be_get_Copy_op(const ir_node *cpy)
ir_node *be_new_Keep(ir_node *const block, int const n, ir_node *const *const in) ir_node *be_new_Keep(ir_node *const block, int const n, ir_node *const *const in)
{ {
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node *res = new_ir_node(NULL, irg, block, op_be_Keep, mode_ANY, -1, NULL); ir_node *res = new_ir_node(NULL, irg, block, op_be_Keep, mode_ANY, -1, NULL);
init_node_attr(res, -1, 1, arch_irn_flag_schedule_first); init_node_attr(res, -1, 1, arch_irn_flag_schedule_first);
be_node_attr_t *attr = (be_node_attr_t*) get_irn_generic_attr(res); be_node_attr_t *attr = (be_node_attr_t*) get_irn_generic_attr(res);
...@@ -328,7 +328,7 @@ ir_node *be_new_Call(dbg_info *const dbg, ir_node *const bl, ir_node *const mem, ...@@ -328,7 +328,7 @@ ir_node *be_new_Call(dbg_info *const dbg, ir_node *const bl, ir_node *const mem,
real_in[n_be_Call_ptr] = ptr; real_in[n_be_Call_ptr] = ptr;
memcpy(&real_in[n_be_Call_first_arg], in, n * sizeof(in[0])); memcpy(&real_in[n_be_Call_first_arg], in, n * sizeof(in[0]));
ir_graph *const irg = get_Block_irg(bl); ir_graph *const irg = get_irn_irg(bl);
ir_node *const irn = new_ir_node(dbg, irg, bl, op_be_Call, mode_T, real_n, real_in); ir_node *const irn = new_ir_node(dbg, irg, bl, op_be_Call, mode_T, real_n, real_in);
init_node_attr(irn, real_n, n_outs, arch_irn_flags_none); init_node_attr(irn, real_n, n_outs, arch_irn_flags_none);
be_call_attr_t *a = (be_call_attr_t*)get_irn_generic_attr(irn); be_call_attr_t *a = (be_call_attr_t*)get_irn_generic_attr(irn);
...@@ -385,7 +385,7 @@ ir_node *be_new_Return(dbg_info *const dbg, ir_node *const block, ...@@ -385,7 +385,7 @@ ir_node *be_new_Return(dbg_info *const dbg, ir_node *const block,
int const n_res, unsigned const pop, int const n, int const n_res, unsigned const pop, int const n,
ir_node *const *const in) ir_node *const *const in)
{ {
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
ir_node *const res = new_ir_node(dbg, irg, block, op_be_Return, mode_X, n, in); ir_node *const res = new_ir_node(dbg, irg, block, op_be_Return, mode_X, n, in);
init_node_attr(res, n, 1, arch_irn_flags_none); init_node_attr(res, n, 1, arch_irn_flags_none);
be_set_constr_out(res, 0, arch_no_register_req); be_set_constr_out(res, 0, arch_no_register_req);
...@@ -425,7 +425,7 @@ void be_Return_set_emit_pop(ir_node *ret, int emit_pop) ...@@ -425,7 +425,7 @@ void be_Return_set_emit_pop(ir_node *ret, int emit_pop)
ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl, ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl,
ir_node *old_sp, int offset, int align) ir_node *old_sp, int offset, int align)
{ {
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
ir_node *in[] = { old_sp }; ir_node *in[] = { old_sp };
ir_node *irn = new_ir_node(NULL, irg, bl, op_be_IncSP, sp->reg_class->mode, ir_node *irn = new_ir_node(NULL, irg, bl, op_be_IncSP, sp->reg_class->mode,
ARRAY_SIZE(in), in); ARRAY_SIZE(in), in);
...@@ -444,7 +444,7 @@ ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl, ...@@ -444,7 +444,7 @@ ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl,
ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp,
ir_node *sz) ir_node *sz)
{ {
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
ir_node *in[] = { old_sp, sz }; ir_node *in[] = { old_sp, sz };
assert(ARRAY_SIZE(in) == n_be_AddSP_max+1); assert(ARRAY_SIZE(in) == n_be_AddSP_max+1);
ir_node *irn = new_ir_node(NULL, irg, bl, op_be_AddSP, mode_T, ir_node *irn = new_ir_node(NULL, irg, bl, op_be_AddSP, mode_T,
...@@ -464,7 +464,7 @@ ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ...@@ -464,7 +464,7 @@ ir_node *be_new_AddSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp,
ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz) ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, ir_node *sz)
{ {
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
ir_node *in[] = { old_sp, sz }; ir_node *in[] = { old_sp, sz };
assert(ARRAY_SIZE(in) == n_be_SubSP_max+1); assert(ARRAY_SIZE(in) == n_be_SubSP_max+1);
ir_node *irn = new_ir_node(NULL, irg, bl, op_be_SubSP, mode_T, ir_node *irn = new_ir_node(NULL, irg, bl, op_be_SubSP, mode_T,
...@@ -483,7 +483,7 @@ ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, i ...@@ -483,7 +483,7 @@ ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, i
ir_node *be_new_Start(dbg_info *dbgi, ir_node *bl, int n_outs) ir_node *be_new_Start(dbg_info *dbgi, ir_node *bl, int n_outs)
{ {
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
ir_node *res = new_ir_node(dbgi, irg, bl, op_be_Start, mode_T, 0, NULL); ir_node *res = new_ir_node(dbgi, irg, bl, op_be_Start, mode_T, 0, NULL);
init_node_attr(res, 0, n_outs, arch_irn_flag_schedule_first); init_node_attr(res, 0, n_outs, arch_irn_flag_schedule_first);
be_node_attr_t *attr = (be_node_attr_t*) get_irn_generic_attr(res); be_node_attr_t *attr = (be_node_attr_t*) get_irn_generic_attr(res);
...@@ -494,7 +494,7 @@ ir_node *be_new_Start(dbg_info *dbgi, ir_node *bl, int n_outs) ...@@ -494,7 +494,7 @@ ir_node *be_new_Start(dbg_info *dbgi, ir_node *bl, int n_outs)
ir_node *be_new_CopyKeep(ir_node *bl, ir_node *src, int n, ir_node *in_keep[]) ir_node *be_new_CopyKeep(ir_node *bl, ir_node *src, int n, ir_node *in_keep[])
{ {
ir_mode *mode = get_irn_mode(src); ir_mode *mode = get_irn_mode(src);
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
int arity = n+1; int arity = n+1;
ir_node **in = ALLOCAN(ir_node*, arity); ir_node **in = ALLOCAN(ir_node*, arity);
in[0] = src; in[0] = src;
......
...@@ -205,7 +205,7 @@ static void mark_iterated_dominance_frontiers( ...@@ -205,7 +205,7 @@ static void mark_iterated_dominance_frontiers(
static ir_node *insert_dummy_phi(be_ssa_construction_env_t *env, ir_node *block) static ir_node *insert_dummy_phi(be_ssa_construction_env_t *env, ir_node *block)
{ {
int i, n_preds = get_Block_n_cfgpreds(block); int i, n_preds = get_Block_n_cfgpreds(block);
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
ir_node **ins = ALLOCAN(ir_node*, n_preds); ir_node **ins = ALLOCAN(ir_node*, n_preds);
ir_node *dummy; ir_node *dummy;
ir_node *phi; ir_node *phi;
......
...@@ -119,7 +119,7 @@ typedef struct bias_walk { ...@@ -119,7 +119,7 @@ typedef struct bias_walk {
static int process_stack_bias(ir_node *bl, int real_bias) static int process_stack_bias(ir_node *bl, int real_bias)
{ {
int wanted_bias = real_bias; int wanted_bias = real_bias;
ir_graph *irg = get_Block_irg(bl); ir_graph *irg = get_irn_irg(bl);
be_stack_layout_t *layout = be_get_irg_stack_layout(irg); be_stack_layout_t *layout = be_get_irg_stack_layout(irg);
bool sp_relative = layout->sp_relative; bool sp_relative = layout->sp_relative;
const arch_env_t *arch_env = be_get_irg_arch_env(irg); const arch_env_t *arch_env = be_get_irg_arch_env(irg);
......
...@@ -74,7 +74,7 @@ void be_duplicate_deps(ir_node *old_node, ir_node *new_node) ...@@ -74,7 +74,7 @@ void be_duplicate_deps(ir_node *old_node, ir_node *new_node)
ir_node *be_transform_phi(ir_node *node, const arch_register_req_t *req) ir_node *be_transform_phi(ir_node *node, const arch_register_req_t *req)
{ {
ir_node *block = be_transform_node(get_nodes_block(node)); ir_node *block = be_transform_node(get_nodes_block(node));
ir_graph *irg = get_Block_irg(block); ir_graph *irg = get_irn_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node); dbg_info *dbgi = get_irn_dbg_info(node);
/* phi nodes allow loops, so we use the old arguments for now /* phi nodes allow loops, so we use the old arguments for now
......
...@@ -1508,7 +1508,7 @@ static bool should_align_block(const ir_node *block) ...@@ -1508,7 +1508,7 @@ static bool should_align_block(const ir_node *block)
*/ */
static void ia32_emit_block_header(ir_node *block) static void ia32_emit_block_header(ir_node *block)
{ {
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
if (block == get_irg_end_block(irg)) if (block == get_irg_end_block(irg))
return; return;
......
...@@ -138,7 +138,7 @@ static void peephole_ia32_Cmp(ir_node *const node) ...@@ -138,7 +138,7 @@ static void peephole_ia32_Cmp(ir_node *const node)
dbg_info *const dbgi = get_irn_dbg_info(node); dbg_info *const dbgi = get_irn_dbg_info(node);
ir_node *const block = get_nodes_block(node); ir_node *const block = get_nodes_block(node);
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(node);
ir_node *const noreg = ia32_new_NoReg_gp(irg); ir_node *const noreg = ia32_new_NoReg_gp(irg);
ir_node *const nomem = get_irg_no_mem(irg); ir_node *const nomem = get_irg_no_mem(irg);
ir_node *const op = get_irn_n(node, n_ia32_Cmp_left); ir_node *const op = get_irn_n(node, n_ia32_Cmp_left);
......
...@@ -868,7 +868,7 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block, ...@@ -868,7 +868,7 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block,
use_am && ia32_use_source_address_mode(block, op2, op1, other_op, flags)) { use_am && ia32_use_source_address_mode(block, op2, op1, other_op, flags)) {
build_address(am, op2, x86_create_am_normal); build_address(am, op2, x86_create_am_normal);
new_op1 = (op1 == NULL ? NULL : be_transform_node(op1)); new_op1 = (op1 == NULL ? NULL : be_transform_node(op1));
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
new_op2 = get_noreg(irg, mode); new_op2 = get_noreg(irg, mode);
am->op_type = ia32_AddrModeS; am->op_type = ia32_AddrModeS;
} else if (commutative && (new_op2 == NULL || use_am_and_immediates) && } else if (commutative && (new_op2 == NULL || use_am_and_immediates) &&
...@@ -876,7 +876,7 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block, ...@@ -876,7 +876,7 @@ static void match_arguments(ia32_address_mode_t *am, ir_node *block,
ia32_use_source_address_mode(block, op1, op2, other_op, flags)) { ia32_use_source_address_mode(block, op1, op2, other_op, flags)) {
build_address(am, op1, x86_create_am_normal); build_address(am, op1, x86_create_am_normal);
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
ir_node *const noreg = get_noreg(irg, mode); ir_node *const noreg = get_noreg(irg, mode);
if (new_op2 != NULL) { if (new_op2 != NULL) {
new_op1 = noreg; new_op1 = noreg;
...@@ -1735,7 +1735,7 @@ static ir_node *create_sex_32_64(dbg_info *dbgi, ir_node *block, ...@@ -1735,7 +1735,7 @@ static ir_node *create_sex_32_64(dbg_info *dbgi, ir_node *block,
ir_node *pval = new_bd_ia32_ProduceVal(dbgi, block); ir_node *pval = new_bd_ia32_ProduceVal(dbgi, block);
res = new_bd_ia32_Cltd(dbgi, block, val, pval); res = new_bd_ia32_Cltd(dbgi, block, val, pval);
} else { } else {
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
ir_node *const imm31 = ia32_create_Immediate(irg, NULL, 31); ir_node *const imm31 = ia32_create_Immediate(irg, NULL, 31);
res = new_bd_ia32_Sar(dbgi, block, val, imm31); res = new_bd_ia32_Sar(dbgi, block, val, imm31);
} }
...@@ -1955,7 +1955,7 @@ static ir_node *gen_Minus(ir_node *node) ...@@ -1955,7 +1955,7 @@ static ir_node *gen_Minus(ir_node *node)
/* TODO: non-optimal... if we have many xXors, then we should /* TODO: non-optimal... if we have many xXors, then we should
* rather create a load for the const and use that instead of * rather create a load for the const and use that instead of
* several AM nodes... */ * several AM nodes... */
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
ir_node *const noreg_xmm = ia32_new_NoReg_xmm(irg); ir_node *const noreg_xmm = ia32_new_NoReg_xmm(irg);
ir_node *const base = get_global_base(irg); ir_node *const base = get_global_base(irg);
new_node = new_bd_ia32_xXor(dbgi, block, base, noreg_GP, nomem, new_op, noreg_xmm); new_node = new_bd_ia32_xXor(dbgi, block, base, noreg_GP, nomem, new_op, noreg_xmm);
...@@ -2002,7 +2002,7 @@ static ir_node *create_float_abs(dbg_info *dbgi, ir_node *block, ir_node *op, ...@@ -2002,7 +2002,7 @@ static ir_node *create_float_abs(dbg_info *dbgi, ir_node *block, ir_node *op,
ir_node *new_node; ir_node *new_node;
if (ia32_cg_config.use_sse2) { if (ia32_cg_config.use_sse2) {
ir_graph *const irg = get_Block_irg(new_block); ir_graph *const irg = get_irn_irg(new_block);
ir_node *const noreg_fp = ia32_new_NoReg_xmm(irg); ir_node *const noreg_fp = ia32_new_NoReg_xmm(irg);
ir_node *const base = get_global_base(irg); ir_node *const base = get_global_base(irg);
new_node = new_bd_ia32_xAnd(dbgi, new_block, base, noreg_GP, nomem, new_op, noreg_fp); new_node = new_bd_ia32_xAnd(dbgi, new_block, base, noreg_GP, nomem, new_op, noreg_fp);
...@@ -2683,7 +2683,7 @@ static ir_node *gen_float_const_Store(ir_node *node, ir_node *cns) ...@@ -2683,7 +2683,7 @@ static ir_node *gen_float_const_Store(ir_node *node, ir_node *cns)
} else { } else {
panic("invalid size of Store float to mem (%+F)", node); panic("invalid size of Store float to mem (%+F)", node);
} }
ir_graph *const irg = get_Block_irg(new_block); ir_graph *const irg = get_irn_irg(new_block);
ir_node *const imm = ia32_create_Immediate(irg, NULL, val); ir_node *const imm = ia32_create_Immediate(irg, NULL, val);
ir_node *new_node = new_bd_ia32_Store(dbgi, new_block, addr.base, ir_node *new_node = new_bd_ia32_Store(dbgi, new_block, addr.base,
...@@ -2724,7 +2724,7 @@ static ir_node *gen_fist(dbg_info *dbgi, ir_node *block, ir_node *base, ...@@ -2724,7 +2724,7 @@ static ir_node *gen_fist(dbg_info *dbgi, ir_node *block, ir_node *base,
* value is copied if other users exists */ * value is copied if other users exists */
return new_bd_ia32_fisttp(dbgi, block, base, index, mem, val); return new_bd_ia32_fisttp(dbgi, block, base, index, mem, val);
} else { } else {
ir_graph *const irg = get_Block_irg(block); ir_graph *const irg = get_irn_irg(block);
ir_node *const trunc_mode = ia32_new_Fpu_truncate(irg); ir_node *const trunc_mode = ia32_new_Fpu_truncate(irg);
/* do a fist */ /* do a fist */
...@@ -3528,7 +3528,7 @@ static ir_node *gen_Mux(ir_node *node) ...@@ -3528,7 +3528,7 @@ static ir_node *gen_Mux(ir_node *node)
panic("Unsupported constant size"); panic("Unsupported constant size");
} }
ir_graph *const irg = get_Block_irg(new_block); ir_graph *const irg = get_irn_irg(new_block);
am.ls_mode = new_mode; am.ls_mode = new_mode;
am.addr.base = get_global_base(irg); am.addr.base = get_global_base(irg);
am.addr.index = new_node; am.addr.index = new_node;
...@@ -3629,7 +3629,7 @@ static ir_node *gen_Mux(ir_node *node) ...@@ -3629,7 +3629,7 @@ static ir_node *gen_Mux(ir_node *node)
break; break;
case SETCC_TR_SHL: { case SETCC_TR_SHL: {
ir_graph *const irg = get_Block_irg(new_block); ir_graph *const irg = get_irn_irg(new_block);
imm = ia32_immediate_from_long(irg, res.steps[step].scale); imm = ia32_immediate_from_long(irg, res.steps[step].scale);
SET_IA32_ORIG_NODE(imm, node); SET_IA32_ORIG_NODE(imm, node);
new_node = new_bd_ia32_Shl(dbgi, new_block, new_node, imm); new_node = new_bd_ia32_Shl(dbgi, new_block, new_node, imm);
...@@ -3647,7 +3647,7 @@ static ir_node *gen_Mux(ir_node *node) ...@@ -3647,7 +3647,7 @@ static ir_node *gen_Mux(ir_node *node)
break; break;
case SETCC_TR_AND: