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

avoid new_NoMem in favor or get_irg_no_mem

parent 13c55699
......@@ -184,7 +184,7 @@ static void transform_Spill(ir_node *node)
ir_node *block = get_nodes_block(node);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *ptr = get_irg_frame(irg);
ir_node *mem = new_r_NoMem(irg);
ir_node *mem = get_irg_no_mem(irg);
ir_node *val = get_irn_n(node, n_be_Spill_val);
//ir_mode *mode = get_irn_mode(val);
ir_entity *entity = be_get_frame_entity(node);
......
......@@ -1165,7 +1165,7 @@ static ir_node *ints_to_double(dbg_info *dbgi, ir_node *block, ir_node *node0,
* registers... */
ir_graph *irg = current_ir_graph;
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *str0 = new_bd_arm_Str(dbgi, block, stack, node0, nomem, mode_gp,
NULL, 0, 0, true);
ir_node *str1 = new_bd_arm_Str(dbgi, block, stack, node1, nomem, mode_gp,
......@@ -1186,7 +1186,7 @@ static ir_node *int_to_float(dbg_info *dbgi, ir_node *block, ir_node *node)
{
ir_graph *irg = current_ir_graph;
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *str = new_bd_arm_Str(dbgi, block, stack, node, nomem, mode_gp,
NULL, 0, 0, true);
ir_node *ldf;
......@@ -1202,7 +1202,7 @@ static ir_node *float_to_int(dbg_info *dbgi, ir_node *block, ir_node *node)
{
ir_graph *irg = current_ir_graph;
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_F,
NULL, 0, 0, true);
ir_node *ldr;
......@@ -1219,7 +1219,7 @@ static void double_to_ints(dbg_info *dbgi, ir_node *block, ir_node *node,
{
ir_graph *irg = current_ir_graph;
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = new_bd_arm_Stf(dbgi, block, stack, node, nomem, mode_D,
NULL, 0, 0, true);
ir_node *ldr0, *ldr1;
......
......@@ -190,7 +190,7 @@ static void transform_Spill(ir_node *node)
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *ptr = get_irn_n(node, n_be_Spill_frame);
ir_graph *irg = get_irn_irg(node);
ir_node *mem = new_r_NoMem(irg);
ir_node *mem = get_irg_no_mem(irg);
ir_node *val = get_irn_n(node, n_be_Spill_val);
ir_mode *mode = get_irn_mode(val);
ir_entity *entity = be_get_frame_entity(node);
......
......@@ -470,7 +470,8 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
/* Insert a store for primitive arguments. */
if (is_atomic_type(param_type)) {
ir_node *mem_input = do_seq ? curr_mem : new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *mem_input = do_seq ? curr_mem : nomem;
ir_node *store = new_rd_Store(dbgi, bl, mem_input, addr, param, cons_none);
mem = new_r_Proj(store, mode_M, pn_Store_M);
} else {
......@@ -1861,8 +1862,9 @@ static void modify_irg(ir_graph *irg)
if (is_atomic_type(param_type) && get_irn_n_edges(args[i]) > 0) {
ir_mode *mode = get_type_mode(param_type);
ir_mode *load_mode = arg->load_mode;
ir_node *nomem = get_irg_no_mem(irg);
ir_node *load = new_r_Load(start_bl, new_r_NoMem(irg), addr, load_mode, cons_floats);
ir_node *load = new_r_Load(start_bl, nomem, addr, load_mode, cons_floats);
repl = new_r_Proj(load, load_mode, pn_Load_res);
if (mode != load_mode) {
......@@ -2096,7 +2098,7 @@ static void fix_pic_symconsts(ir_node *node, void *data)
/* we need an extra indirection for global data outside our current
module. The loads are always safe and can therefore float
and need no memory input */
load = new_r_Load(block, new_r_NoMem(irg), add, mode, cons_floats);
load = new_r_Load(block, get_irg_no_mem(irg), add, mode, cons_floats);
load_res = new_r_Proj(load, mode, pn_Load_res);
set_irn_n(node, i, load_res);
......
......@@ -411,7 +411,7 @@ static void spill_irn(spill_env_t *env, spill_info_t *spillinfo)
if (!sched_is_scheduled(insn)) {
/* override spillinfos or create a new one */
ir_graph *irg = get_irn_irg(to_spill);
spillinfo->spills->spill = new_r_NoMem(irg);
spillinfo->spills->spill = get_irg_no_mem(irg);
DB((dbg, LEVEL_1, "don't spill %+F use NoMem\n", to_spill));
return;
}
......@@ -763,7 +763,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo)
spill_t *spill = OALLOC(&env->obst, spill_t);
spill->after = NULL;
spill->next = NULL;
spill->spill = new_r_NoMem(irg);
spill->spill = get_irg_no_mem(irg);
spillinfo->spills = spill;
spillinfo->spill_costs = 0;
......
......@@ -275,8 +275,11 @@ static int get_start_reg_index(ir_graph *irg, const arch_register_t *reg)
= arch_get_out_register_req(start, i);
if (! (out_req->type & arch_register_req_type_limited))
continue;
if (rbitset_is_set(out_req->limited, reg->index))
return i;
if (out_req->cls != arch_register_get_class(reg))
continue;
if (!rbitset_is_set(out_req->limited, reg->index))
continue;
return i;
}
panic("Tried querying undefined register '%s' at Start", reg->name);
}
......@@ -455,7 +458,7 @@ static arch_inverse_t *ia32_get_inverse(const ir_node *irn, int i, arch_inverse_
mode = get_irn_mode(irn);
irn_mode = get_irn_mode(irn);
noreg = get_irn_n(irn, 0);
nomem = new_r_NoMem(irg);
nomem = get_irg_no_mem(irg);
dbg = get_irn_dbg_info(irn);
/* initialize structure */
......@@ -755,7 +758,7 @@ ir_node *ia32_turn_back_am(ir_node *node)
ia32_copy_am_attrs(load, node);
if (is_ia32_is_reload(node))
set_ia32_is_reload(load);
set_irn_n(node, n_ia32_mem, new_r_NoMem(irg));
set_irn_n(node, n_ia32_mem, get_irg_no_mem(irg));
switch (get_ia32_am_support(node)) {
case ia32_am_unary:
......@@ -922,7 +925,7 @@ static void transform_to_Store(ir_node *node)
const ir_node *spillval = get_irn_n(node, n_be_Spill_val);
ir_mode *mode = get_spill_mode(spillval);
ir_node *noreg = ia32_new_NoReg_gp(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *ptr = get_irg_frame(irg);
ir_node *val = get_irn_n(node, n_be_Spill_val);
ir_node *store;
......@@ -990,7 +993,8 @@ static ir_node *create_pop(ir_node *node, ir_node *schedpoint, ir_node *sp, ir_e
ir_node *noreg = ia32_new_NoReg_gp(irg);
ir_node *frame = get_irg_frame(irg);
ir_node *pop = new_bd_ia32_PopMem(dbg, block, frame, noreg, new_r_NoMem(irg), sp);
ir_node *pop = new_bd_ia32_PopMem(dbg, block, frame, noreg,
get_irg_no_mem(irg), sp);
set_ia32_frame_ent(pop, ent);
set_ia32_use_frame(pop);
......
......@@ -68,7 +68,7 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn)
irg = get_irn_irg(irn);
noreg = ia32_new_NoReg_gp(irg);
noreg_fp = ia32_new_NoReg_xmm(irg);
nomem = new_r_NoMem(irg);
nomem = get_irg_no_mem(irg);
in1 = get_irn_n(irn, n_ia32_binary_left);
in2 = get_irn_n(irn, n_ia32_binary_right);
in1_reg = arch_get_irn_register(in1);
......
......@@ -105,7 +105,7 @@ static ir_node *create_fpu_mode_spill(void *env, ir_node *state, int force,
ir_graph *irg = get_irn_irg(state);
ir_node *block = get_nodes_block(state);
ir_node *noreg = ia32_new_NoReg_gp(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *frame = get_irg_frame(irg);
spill = new_bd_ia32_FnstCW(NULL, block, frame, noreg, nomem, state);
......@@ -123,7 +123,7 @@ static ir_node *create_fpu_mode_spill(void *env, ir_node *state, int force,
static ir_node *create_fldcw_ent(ir_node *block, ir_entity *entity)
{
ir_graph *irg = get_irn_irg(block);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *noreg = ia32_new_NoReg_gp(irg);
ir_node *reload;
......@@ -171,7 +171,7 @@ static ir_node *create_fpu_mode_reload(void *env, ir_node *state,
sched_add_before(before, reload);
} else {
ir_mode *lsmode = ia32_reg_classes[CLASS_ia32_fp_cw].mode;
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *cwstore, *load, *load_res, *orn, *store, *fldcw;
ir_node *or_const;
......
......@@ -544,7 +544,7 @@ static ir_node *create_push(dbg_info *dbgi, ir_node *block,
ir_node *val = ia32_new_NoReg_gp(cg);
ir_node *noreg = ia32_new_NoReg_gp(cg);
ir_graph *irg = get_irn_irg(block);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *push = new_bd_ia32_Push(dbgi, block, noreg, noreg, nomem, val, stack);
sched_add_before(schedpoint, push);
......@@ -858,7 +858,7 @@ static ir_node *create_pop(dbg_info *dbgi, ir_node *block,
ir_node *val;
ir_node *in[1];
pop = new_bd_ia32_Pop(dbgi, block, new_r_NoMem(irg), stack);
pop = new_bd_ia32_Pop(dbgi, block, get_irg_no_mem(irg), stack);
stack = new_r_Proj(pop, mode_Iu, pn_ia32_Pop_stack);
arch_set_irn_register(stack, esp);
......@@ -1155,7 +1155,7 @@ make_add:
block = get_nodes_block(node);
irg = get_irn_irg(node);
noreg = ia32_new_NoReg_gp(irg);
nomem = new_r_NoMem(irg);
nomem = get_irg_no_mem(irg);
res = new_bd_ia32_Add(dbgi, block, noreg, noreg, nomem, op1, op2);
arch_set_irn_register(res, out_reg);
set_ia32_commutative(res);
......@@ -1166,7 +1166,7 @@ make_shl:
block = get_nodes_block(node);
irg = get_irn_irg(node);
noreg = ia32_new_NoReg_gp(irg);
nomem = new_r_NoMem(irg);
nomem = get_irg_no_mem(irg);
res = new_bd_ia32_Shl(dbgi, block, op1, op2);
arch_set_irn_register(res, out_reg);
goto exchange;
......
......@@ -1195,14 +1195,15 @@ static int sim_store(x87_state *state, ir_node *n, ir_op *op, ir_op *op_p)
x87_patch_insn(n, op_p);
} else {
ir_node *vfld, *mem, *block, *rproj, *mproj;
ir_graph *irg = get_irn_irg(n);
ir_graph *irg = get_irn_irg(n);
ir_node *nomem = get_irg_no_mem(irg);
/* stack full here: need fstp + load */
x87_pop(state);
x87_patch_insn(n, op_p);
block = get_nodes_block(n);
vfld = new_bd_ia32_vfld(NULL, block, get_irn_n(n, 0), get_irn_n(n, 1), new_r_NoMem(irg), get_ia32_ls_mode(n));
vfld = new_bd_ia32_vfld(NULL, block, get_irn_n(n, 0), get_irn_n(n, 1), nomem, get_ia32_ls_mode(n));
/* copy all attributes */
set_ia32_frame_ent(vfld, get_ia32_frame_ent(n));
......
......@@ -202,7 +202,7 @@ static void transform_Spill(ir_node *node)
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *ptr = get_irn_n(node, n_be_Spill_frame);
ir_graph *irg = get_irn_irg(node);
ir_node *mem = new_r_NoMem(irg);
ir_node *mem = get_irg_no_mem(irg);
ir_node *val = get_irn_n(node, n_be_Spill_val);
ir_mode *mode = get_irn_mode(val);
ir_entity *entity = be_get_frame_entity(node);
......
......@@ -851,7 +851,7 @@ static ir_node *gen_float_const(dbg_info *dbgi, ir_node *block, ir_tarval *tv)
{
ir_entity *entity = create_float_const_entity(tv);
ir_node *hi = new_bd_sparc_SetHi(dbgi, block, entity, 0);
ir_node *mem = new_r_NoMem(current_ir_graph);
ir_node *mem = get_irg_no_mem(current_ir_graph);
ir_mode *mode = get_tarval_mode(tv);
ir_node *new_op
= create_ldf(dbgi, block, hi, mem, mode, entity, 0, false);
......@@ -937,7 +937,7 @@ static ir_node *gen_SwitchJmp(ir_node *node)
index = new_bd_sparc_Sll_imm(dbgi, block, new_selector, NULL, 2);
/* load from jumptable */
load = new_bd_sparc_Ld_reg(dbgi, block, table_address, index,
new_r_NoMem(current_ir_graph),
get_irg_no_mem(current_ir_graph),
mode_gp);
address = new_r_Proj(load, mode_gp, pn_sparc_Ld_res);
......@@ -1094,7 +1094,7 @@ static ir_node *create_ftoi(dbg_info *dbgi, ir_node *block, ir_node *op,
{
ir_graph *irg = get_irn_irg(block);
ir_node *sp = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = create_stf(dbgi, block, ftoi, sp, nomem, src_mode,
NULL, 0, true);
ir_node *ld = new_bd_sparc_Ld_imm(dbgi, block, sp, stf, mode_gp,
......@@ -1111,7 +1111,7 @@ static ir_node *create_itof(dbg_info *dbgi, ir_node *block, ir_node *op,
{
ir_graph *irg = get_irn_irg(block);
ir_node *sp = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *st = new_bd_sparc_St_imm(dbgi, block, op, sp, nomem,
mode_gp, NULL, 0, true);
ir_node *ldf = new_bd_sparc_Ldf_s(dbgi, block, sp, st, mode_fp,
......@@ -1452,7 +1452,7 @@ static ir_node *bitcast_int_to_float(dbg_info *dbgi, ir_node *block,
{
ir_graph *irg = current_ir_graph;
ir_node *sp = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *st = new_bd_sparc_St_imm(dbgi, block, value0, sp, nomem,
mode_gp, NULL, 0, true);
ir_mode *mode;
......@@ -1485,7 +1485,7 @@ static void bitcast_float_to_int(dbg_info *dbgi, ir_node *block,
{
ir_graph *irg = current_ir_graph;
ir_node *stack = get_irg_frame(irg);
ir_node *nomem = new_r_NoMem(irg);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *stf = create_stf(dbgi, block, node, stack, nomem, float_mode,
NULL, 0, true);
int bits = get_mode_size_bits(float_mode);
......
Markdown is supported
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