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);
/** Returns 1 if a block is marked as visited */
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) */
FIRM_API ir_entity *create_Block_entity(ir_node *block);
/** Returns the head of the Phi list for this block. */
......
......@@ -256,7 +256,7 @@ result_unknown_X:
}
if (!reachable) {
ir_graph *const irg = get_Block_irg(irn);
ir_graph *const irg = get_irn_irg(irn);
reachable =
irn == get_irg_start_block(irg) ||
irn == get_irg_end_block(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_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_entity *entity = create_float_const_entity(irg, tv);
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,
/* the good way to do this would be to use the stm (store multiple)
* instructions, since our input is nearly always 2 consecutive 32bit
* registers... */
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg);
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,
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 *nomem = get_irg_no_mem(irg);
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)
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 *nomem = get_irg_no_mem(irg);
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)
static void double_to_ints(dbg_info *dbgi, ir_node *block, ir_node *node,
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 *nomem = get_irg_no_mem(irg);
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)
long pn = get_Proj_proj(node);
ir_node *block = get_nodes_block(node);
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 *start = get_Proj_pred(args);
ir_node *new_start = be_transform_node(start);
......
......@@ -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)
{
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_mode *mode = get_irn_mode(value);
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)
static ir_node *arm_new_spill(ir_node *value, ir_node *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 *mem = get_irg_no_mem(irg);
ir_mode *mode = get_irn_mode(value);
......
......@@ -687,7 +687,7 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size,
return 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);
size = new_rd_Add(dbg, block, size, mask, mode);
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,
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_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);
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)
{
ir_node *const bl = get_nodes_block(irn);
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);
/* get the valid stack node in this 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);
}
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));
kill_node(jump);
blocks_removed = true;
......
......@@ -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
* live at after's definition (value dominates 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);
if (be_is_live_end(lv, bb, value))
return true;
......@@ -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
* live at b's definition (a dominates 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);
if (be_is_live_end(lv, bb, a))
return true;
......
......@@ -59,7 +59,7 @@ static unsigned be_compute_block_pressure(ir_node *const block, arch_register_cl
/* determine largest pressure with this block */
ir_nodeset_t 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);
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)
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);
init_node_attr(irn, n, n, arch_irn_flags_none);
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)
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);
ir_node *frame = get_irg_frame(irg);
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)
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 *res = new_ir_node(NULL, irg, bl, op_be_Copy, get_irn_mode(op),
ARRAY_SIZE(in), in);
......@@ -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_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);
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);
......@@ -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;
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);
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);
......@@ -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,
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);
init_node_attr(res, n, 1, arch_irn_flags_none);
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)
ir_node *be_new_IncSP(const arch_register_t *sp, ir_node *bl,
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 *irn = new_ir_node(NULL, irg, bl, op_be_IncSP, sp->reg_class->mode,
ARRAY_SIZE(in), in);
......@@ -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 *sz)
{
ir_graph *irg = get_Block_irg(bl);
ir_graph *irg = get_irn_irg(bl);
ir_node *in[] = { old_sp, sz };
assert(ARRAY_SIZE(in) == n_be_AddSP_max+1);
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,
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 };
assert(ARRAY_SIZE(in) == n_be_SubSP_max+1);
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
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);
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);
......@@ -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_mode *mode = get_irn_mode(src);
ir_graph *irg = get_Block_irg(bl);
ir_graph *irg = get_irn_irg(bl);
int arity = n+1;
ir_node **in = ALLOCAN(ir_node*, arity);
in[0] = src;
......
......@@ -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)
{
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 *dummy;
ir_node *phi;
......
......@@ -119,7 +119,7 @@ typedef struct bias_walk {
static int process_stack_bias(ir_node *bl, int 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);
bool sp_relative = layout->sp_relative;
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)
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_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
/* 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)
*/
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))
return;
......
......@@ -138,7 +138,7 @@ static void peephole_ia32_Cmp(ir_node *const node)
dbg_info *const dbgi = get_irn_dbg_info(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 nomem = get_irg_no_mem(irg);
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,
use_am && ia32_use_source_address_mode(block, op2, op1, other_op, flags)) {
build_address(am, op2, x86_create_am_normal);
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);
am->op_type = ia32_AddrModeS;
} 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,
ia32_use_source_address_mode(block, op1, op2, other_op, flags)) {
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);
if (new_op2 != NULL) {
new_op1 = noreg;
......@@ -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);
res = new_bd_ia32_Cltd(dbgi, block, val, pval);
} 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);
res = new_bd_ia32_Sar(dbgi, block, val, imm31);
}
......@@ -1955,7 +1955,7 @@ static ir_node *gen_Minus(ir_node *node)
/* TODO: non-optimal... if we have many xXors, then we should
* rather create a load for the const and use that instead of
* 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 base = get_global_base(irg);
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,
ir_node *new_node;
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 base = get_global_base(irg);
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)
} else {
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 *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,
* value is copied if other users exists */
return new_bd_ia32_fisttp(dbgi, block, base, index, mem, val);
} 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);
/* do a fist */
......@@ -3528,7 +3528,7 @@ static ir_node *gen_Mux(ir_node *node)
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.addr.base = get_global_base(irg);
am.addr.index = new_node;
......@@ -3629,7 +3629,7 @@ static ir_node *gen_Mux(ir_node *node)
break;
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);
SET_IA32_ORIG_NODE(imm, node);
new_node = new_bd_ia32_Shl(dbgi, new_block, new_node, imm);
......@@ -3647,7 +3647,7 @@ static ir_node *gen_Mux(ir_node *node)
break;
case SETCC_TR_AND: {
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].val);
SET_IA32_ORIG_NODE(imm, node);
new_node = new_bd_ia32_And(dbgi, new_block, noreg_GP, noreg_GP, nomem, new_node, imm);
......@@ -3689,7 +3689,7 @@ static ir_node *gen_x87_fp_to_gp(ir_node *node)
ir_node *op = get_Conv_op(node);
ir_node *new_op = be_transform_node(op);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *frame = get_irg_frame(irg);
ir_node *fist = gen_fist(dbgi, block, frame, noreg_GP, nomem, new_op);
......@@ -3732,7 +3732,7 @@ static ir_node *gen_x87_fp_to_gp(ir_node *node)
static ir_node *gen_x87_conv(ir_mode *tgt_mode, ir_node *node)
{
ir_node *block = 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);
ir_node *frame = get_irg_frame(irg);
......@@ -3784,7 +3784,7 @@ static void store_gp(dbg_info *dbgi, ia32_address_mode_t *am, ir_node *block,
}
/* do a store */
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *frame = get_irg_frame(irg);
ir_node *new_block = be_transform_node(block);
ir_node *store = new_bd_ia32_Store(dbgi, new_block, frame, noreg_GP,
......@@ -4028,7 +4028,7 @@ static void store_fp(dbg_info *dbgi, ia32_address_mode_t *am, ir_node *block,
/* TODO: match_am if value is a freshly loaded float value */
ir_node *new_block = be_transform_node(block);
ir_node *new_value = be_transform_node(value);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *frame = get_irg_frame(irg);
ir_mode *mode = get_irn_mode(value);
......@@ -4144,7 +4144,7 @@ static ir_node *gen_be_Return(ir_node *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);
ir_entity *ent = get_irg_entity(irg);
ir_type *tp = get_entity_type(ent);
ir_type *res_type = get_method_res_type(tp, 0);
......@@ -4389,7 +4389,7 @@ static ir_node *gen_ia32_l_LLtoFloat(ir_node *node)
ir_node *src_block = get_nodes_block(node);
ir_node *block = be_transform_node(src_block);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *frame = get_irg_frame(irg);
ir_node *val_low = get_irn_n(node, n_ia32_l_LLtoFloat_val_low);
......@@ -4474,7 +4474,7 @@ static ir_node *gen_ia32_l_FloattoLL(ir_node *node)
{
ir_node *src_block = get_nodes_block(node);
ir_node *block = be_transform_node(src_block);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *frame = get_irg_frame(irg);
ir_node *val = get_irn_n(node, n_ia32_l_FloattoLL_val);
......@@ -4496,7 +4496,7 @@ static ir_node *gen_ia32_l_FloattoLL(ir_node *node)
static ir_node *gen_Proj_l_FloattoLL(ir_node *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);
ir_node *pred = get_Proj_pred(node);
ir_node *new_pred = be_transform_node(pred);
ir_node *frame = get_irg_frame(irg);
......@@ -4823,7 +4823,7 @@ static ir_node *gen_be_Call(ir_node *node)
ir_mode *const res_mode = get_type_mode(res_type);
if (res_mode != NULL && mode_is_float(res_mode)) {
ir_graph *const irg = get_Block_irg(block);
ir_graph *const irg = get_irn_irg(block);
ia32_request_x87_sim(irg);
}
}
......@@ -5141,7 +5141,7 @@ static ir_node *gen_clz(ir_node *node)
ir_node *real = skip_Proj(bsr);
dbg_info *dbgi = get_irn_dbg_info(real);
ir_node *block = get_nodes_block(real);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *imm = ia32_create_Immediate(irg, NULL, 31);
return new_bd_ia32_Xor(dbgi, block, noreg_GP, noreg_GP, nomem, bsr, imm);
......@@ -5171,7 +5171,7 @@ static ir_node *gen_parity(ir_node *node)
* (we should also better lower this before the backend so we still have a
* chance for CSE, constant folding and other goodies for some of these
* operations) */
ir_graph *const irg = get_Block_irg(new_block);
ir_graph *const irg = get_irn_irg(new_block);
ir_node *const count = ia32_create_Immediate(irg, NULL, 16);
ir_node *const shr = new_bd_ia32_Shr(dbgi, new_block, new_param, count);
ir_node *const xorn = new_bd_ia32_Xor(dbgi, new_block, noreg_GP,
......@@ -5240,7 +5240,7 @@ static ir_node *gen_bswap(ir_node *node)
/* swap available */
return new_bd_ia32_Bswap(dbgi, new_block, param);
} else {
ir_graph *const irg = get_Block_irg(new_block);
ir_graph *const irg = get_irn_irg(new_block);
ir_node *const i8 = ia32_create_Immediate(irg, NULL, 8);
ir_node *const rol1 = new_bd_ia32_Rol(dbgi, new_block, param, i8);
ir_node *const i16 = ia32_create_Immediate(irg, NULL, 16);
......@@ -5303,7 +5303,7 @@ static ir_node *gen_saturating_increment(ir_node *node)
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *operand = be_transform_node(get_Builtin_param(node, 0));
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *one = ia32_create_Immediate(irg, NULL, 1);
ir_node *increment = new_bd_ia32_Add(dbgi, block, noreg_GP, noreg_GP,
nomem, operand, one);
......@@ -5371,7 +5371,7 @@ static ir_node *gen_inner_trampoline(ir_node *node)
create_transformed_address_mode(&addr, ptr, x86_create_am_normal);
addr.mem = be_transform_node(mem);
ir_graph *const irg = get_Block_irg(new_block);
ir_graph *const irg = get_irn_irg(new_block);
/* mov ecx, <env> */
ir_node *val = ia32_create_Immediate(irg, NULL, 0xB9);
ir_node *store = new_bd_ia32_Store_8bit(dbgi, new_block, addr.base,
......@@ -5807,7 +5807,7 @@ static void postprocess_fp_call_results(void)
if (new_res == NULL) {
ir_node *const block = get_nodes_block(call);
ir_graph *const irg = get_Block_irg(block);
ir_graph *const irg = get_irn_irg(block);
ir_node *const frame = get_irg_frame(irg);
ir_node *const old_mem = be_get_Proj_for_pn(call, pn_ia32_Call_M);
ir_node *const call_mem = new_r_Proj(call, mode_M, pn_ia32_Call_M);
......
......@@ -1417,7 +1417,7 @@ static ir_entity *create_float_const_entity(ir_graph *const irg, ir_tarval *cons
static ir_node *gen_float_const(dbg_info *dbgi, ir_node *block, ir_tarval *tv)
{
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_entity *entity = create_float_const_entity(irg, tv);
ir_node *hi = new_bd_sparc_SetHi(dbgi, block, entity, 0);
ir_node *mem = get_irg_no_mem(irg);
......@@ -1952,7 +1952,7 @@ static ir_node *gen_Return(ir_node *node)
static ir_node *bitcast_int_to_float(dbg_info *dbgi, ir_node *block,
ir_node *value0, ir_node *value1)
{
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *sp = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *st = new_bd_sparc_St_imm(dbgi, block, value0, sp, nomem,
......@@ -2008,7 +2008,7 @@ static void bitcast_float_to_int(dbg_info *dbgi, ir_node *block,
result[1] = NULL;
}
} else {
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *new_value = be_transform_node(value);
......@@ -2358,7 +2358,7 @@ static ir_node *gen_saturating_increment(ir_node *node)
ir_node *increment = new_bd_sparc_AddCC_imm(dbgi, block, operand, NULL, 1);
ir_node *value = new_rd_Proj(dbgi, increment, mode_Iu, pn_sparc_AddCC_res);
ir_node *eflags = new_rd_Proj(dbgi, increment, mode_Iu, pn_sparc_AddCC_flags);
ir_graph *irg = get_Block_irg(block);
ir_graph *irg = get_irn_irg(block);
ir_node *zero = get_g0(irg);
ir_node *sbb = new_bd_sparc_SubX_reg(dbgi, block, value, zero, eflags);
......
......@@ -107,11 +107,6 @@ void copy_irn_to_irg(ir_node *n, ir_graph *irg)
frees e.g. the memory of the graph_arr allocated in new_immBlock. */
copy_node_attr(irg, n, nn);
set_irn_link(n, nn);
/* fix the irg for nodes containing a reference to it */
if (ir_has_irg_ref(nn)) {
nn->attr.block.irg.irg = irg;
}
}
ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
......@@ -135,10 +130,6 @@ ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
/* copy the attributes */
copy_node_attr(irg, node, res);
/* fix irg attribute */
if (ir_has_irg_ref(res))
res->attr.irg.irg = irg;
/* duplicate dependency edges */
for (int i = 0, n_deps = get_irn_n_deps(node); i < n_deps; ++i) {
ir_node *dep = get_irn_dep(node, i);
......
......@@ -308,7 +308,7 @@ ir_node *new_d_ASM(dbg_info *db, ir_node *mem, int arity, ir_node *in[],
ir_node *new_rd_DivRL(dbg_info *dbgi, ir_node *block, ir_node * irn_mem, ir_node * irn_left, ir_node * irn_right, ir_mode* resmode, op_pin_state pin_state)
{
ir_graph *const irg = get_Block_irg(block);
ir_graph *const irg = get_irn_irg(block);
ir_node *const in[] = { irn_mem, irn_left, irn_right };
ir_node *res = new_ir_node(dbgi, irg, block, op_Div, mode_T, 3, in);
res->attr.div.resmode = resmode;
......@@ -338,7 +338,7 @@ ir_node *new_DivRL(ir_node * irn_mem, ir_node * irn_left, ir_node * irn_right, i
ir_node *new_rd_Phi_loop(dbg_info *db, ir_node *block, int arity,
ir_node *in[])
{
ir_graph *const irg = get_Block_irg(block);
ir_graph *const irg = get_irn_irg(block);
ir_node *res = new_ir_node(db, irg, block, op_Phi, mode_M, arity, in);
res->attr.phi.u.backedge = new_backedge_arr(get_irg_obstack(irg), arity);
res->attr.phi.loop = true;
......@@ -375,7 +375,6 @@ ir_node *new_rd_immBlock(dbg_info *dbgi, ir_graph *irg)
set_Block_matured(res, 0);
block_attr *const b = &res->attr.block;
b->dynamic_ins = true;
b->irg.irg = irg;
b->backedge = NULL;