Commit 7fe78d2b authored by Matthias Braun's avatar Matthias Braun
Browse files

remove memory input from Sel node

parent 0c7ff0d2
......@@ -365,13 +365,11 @@ FIRM_API ir_node *new_Const_long(ir_mode *mode, long value);
*
* @param *db A pointer for debug information.
* @param *block The IR block the node belongs to.
* @param *store The memory in which the object the entity should be
* selected from is allocated.
* @param *objptr The object from that the Sel operation selects a
* single attribute out.
* @param *ent The entity to select.
*/
FIRM_API ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block, ir_node *store,
FIRM_API ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block,
ir_node *objptr, ir_entity *ent);
/** Constructor for a simpleSel node.
......@@ -381,15 +379,13 @@ FIRM_API ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block, ir_node *store,
* inputs. It adds the two parameters 0, NULL.
*
* @param *block The IR block the node belongs to.
* @param *store The memory in which the object the entity should be selected
* from is allocated.
* @param *objptr The object from that the Sel operation selects a
* single attribute out.
* @param *ent The entity to select.
* @ingroup Sel
*/
FIRM_API ir_node *new_r_simpleSel(ir_node *block, ir_node *store,
ir_node *objptr, ir_entity *ent);
FIRM_API ir_node *new_r_simpleSel(ir_node *block, ir_node *objptr,
ir_entity *ent);
/** Constructor for a simpleSel node.
*
......@@ -398,13 +394,11 @@ FIRM_API ir_node *new_r_simpleSel(ir_node *block, ir_node *store,
* inputs. It adds the two parameters 0, NULL.
*
* @param *db A pointer for debug information.
* @param *store The memory in which the object the entity should be
* selected from is allocated.
* @param *objptr The object from that the Sel operation selects a
* single attribute out.
* @param *ent The entity to select.
*/
FIRM_API ir_node *new_d_simpleSel(dbg_info *db, ir_node *store, ir_node *objptr,
FIRM_API ir_node *new_d_simpleSel(dbg_info *db, ir_node *objptr,
ir_entity *ent);
/** Constructor for a simpelSel node.
......@@ -413,12 +407,10 @@ FIRM_API ir_node *new_d_simpleSel(dbg_info *db, ir_node *store, ir_node *objptr,
* Sel nodes that do not select from an array, i.e., have no index
* inputs. It adds the two parameters 0, NULL.
*
* @param *store The memory in which the object the entity should be selected from is allocated.
* @param *objptr The object from that the Sel operation selects a single attribute out.
* @param *ent The entity to select.
*/
FIRM_API ir_node *new_simpleSel(ir_node *store, ir_node *objptr,
ir_entity *ent);
FIRM_API ir_node *new_simpleSel(ir_node *objptr, ir_entity *ent);
/** @} */
......
......@@ -675,7 +675,7 @@ static void create_stores_for_type(ir_graph *irg, ir_type *type)
if (arg == IR_VA_START_PARAMETER_NUMBER)
continue;
addr = new_r_Sel(start_block, mem, frame, 0, NULL, entity);
addr = new_r_Sel(start_block, frame, 0, NULL, entity);
if (entity->attr.parameter.doubleword_low_mode != NULL) {
ir_mode *mode = entity->attr.parameter.doubleword_low_mode;
ir_node *val0 = new_r_Proj(args, mode, arg);
......
......@@ -69,10 +69,10 @@ ir_node *new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem,
return res;
}
ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block, ir_node *store,
ir_node *objptr, ir_entity *ent)
ir_node *new_rd_simpleSel(dbg_info *db, ir_node *block, ir_node *objptr,
ir_entity *ent)
{
return new_rd_Sel(db, block, store, objptr, 0, NULL, ent);
return new_rd_Sel(db, block, objptr, 0, NULL, ent);
}
ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value)
......@@ -80,10 +80,9 @@ ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value)
return new_rd_Const_long(NULL, irg, mode, value);
}
ir_node *new_r_simpleSel(ir_node *block, ir_node *store, ir_node *objptr,
ir_entity *ent)
ir_node *new_r_simpleSel(ir_node *block, ir_node *objptr, ir_entity *ent)
{
return new_rd_Sel(NULL, block, store, objptr, 0, NULL, ent);
return new_rd_Sel(NULL, block, objptr, 0, NULL, ent);
}
ir_node *new_r_ASM(ir_node *block, ir_node *mem,
int arity, ir_node *in[], ir_asm_constraint *inputs,
......@@ -296,12 +295,11 @@ ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value)
return new_rd_Const_long(db, current_ir_graph, mode, value);
}
ir_node *new_d_simpleSel(dbg_info *db, ir_node *store, ir_node *objptr,
ir_entity *ent)
ir_node *new_d_simpleSel(dbg_info *db, ir_node *objptr, ir_entity *entity)
{
assert(irg_is_constrained(current_ir_graph, IR_GRAPH_CONSTRAINT_CONSTRUCTION));
return new_rd_Sel(db, current_ir_graph->current_block,
store, objptr, 0, NULL, ent);
return new_rd_Sel(db, current_ir_graph->current_block, objptr, 0, NULL,
entity);
}
ir_node *new_d_ASM(dbg_info *db, ir_node *mem, int arity, ir_node *in[],
......@@ -596,10 +594,11 @@ ir_node *new_Const_long(ir_mode *mode, long value)
return new_d_Const_long(NULL, mode, value);
}
ir_node *new_simpleSel(ir_node *store, ir_node *objptr, ir_entity *ent)
ir_node *new_simpleSel(ir_node *objptr, ir_entity *ent)
{
return new_d_simpleSel(NULL, store, objptr, ent);
return new_d_simpleSel(NULL, objptr, ent);
}
ir_node *new_ASM(ir_node *mem, int arity, ir_node *in[],
ir_asm_constraint *inputs, size_t n_outs,
ir_asm_constraint *outputs, size_t n_clobber,
......
......@@ -307,7 +307,6 @@ ir_node *duplicate_subgraph(dbg_info *dbg, ir_node *n, ir_node *block)
case iro_NoMem:
return get_irg_no_mem(irg);
case iro_Sel: {
ir_node *mem = duplicate_subgraph(dbg, get_Sel_mem(n), block);
ir_node *ptr = duplicate_subgraph(dbg, get_Sel_ptr(n), block);
int n_indexs = get_Sel_n_indexs(n);
ir_node **in = ALLOCAN(ir_node*, n_indexs);
......@@ -315,7 +314,7 @@ ir_node *duplicate_subgraph(dbg_info *dbg, ir_node *n, ir_node *block)
in[i] = duplicate_subgraph(dbg, get_Sel_index(n, i), block);
}
ir_entity *entity = get_Sel_entity(n);
return new_rd_Sel(dbg, block, mem, ptr, n_indexs, in, entity);
return new_rd_Sel(dbg, block, ptr, n_indexs, in, entity);
}
case iro_Unknown:
return new_r_Unknown(irg, mode);
......
......@@ -550,7 +550,6 @@ static int verify_node_Sel(const ir_node *n)
{
bool fine = check_mode_func(n, mode_is_reference, "reference");
fine &= check_input_func(n, n_Sel_ptr, "ptr", mode_is_reference, "reference");
fine &= check_input_mode(n, n_Sel_mem, "mem", mode_M);
for (int i = 0, n_indexs = get_Sel_n_indexs(n); i < n_indexs; ++i) {
fine &= check_input_func(n, n_Sel_max+i+1, NULL, mode_is_int, "int");
......
......@@ -471,7 +471,7 @@ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp)
ident *dummy_id = id_unique("dummy.%u");
ir_entity *ent = new_entity(ft, dummy_id, tp);
return new_r_simpleSel(block, get_irg_no_mem(irg), get_irg_frame(irg), ent);
return new_r_simpleSel(block, get_irg_frame(irg), ent);
}
/**
......@@ -594,7 +594,6 @@ static void fix_compound_params(cl_entry *entry, ir_type *ctp)
dbg_info *dbgi = get_irn_dbg_info(call);
ir_node *mem = get_Call_mem(call);
ir_graph *irg = get_irn_irg(call);
ir_node *nomem = new_r_NoMem(irg);
ir_node *frame = get_irg_frame(irg);
size_t n_params = get_method_n_params(ctp);
......@@ -606,7 +605,7 @@ static void fix_compound_params(cl_entry *entry, ir_type *ctp)
ir_node *arg = get_Call_param(call, i);
ir_entity *arg_entity = create_compound_arg_entity(irg, type);
ir_node *block = get_nodes_block(call);
ir_node *sel = new_rd_simpleSel(dbgi, block, nomem, frame, arg_entity);
ir_node *sel = new_rd_simpleSel(dbgi, block, frame, arg_entity);
bool is_volatile = is_partly_volatile(arg);
mem = new_rd_CopyB(dbgi, block, mem, sel, arg, type, is_volatile ? cons_volatile : cons_none);
set_Call_param(call, i, sel);
......
......@@ -75,21 +75,6 @@ static void lower_sel(ir_node *sel)
idx_mode),
mode);
}
} else if (is_Method_type(get_entity_type(ent)) && is_Class_type(owner)) {
/* We need an additional load when accessing methods from a dispatch
* table.
* Matze TODO: Is this really still used? At least liboo does its own
* lowering of Method-Sels...
*/
ir_mode *ent_mode = get_type_mode(get_entity_type(ent));
int offset = get_entity_offset(ent);
ir_mode *mode_Int = get_reference_mode_signed_eq(mode);
ir_tarval *tv = new_tarval_from_long(offset, mode_Int);
ir_node *cnst = new_rd_Const(dbg, irg, tv);
ir_node *add = new_rd_Add(dbg, bl, get_Sel_ptr(sel), cnst, mode);
ir_node *mem = get_Sel_mem(sel);
newn = new_rd_Load(dbg, bl, mem, add, ent_mode, cons_none);
newn = new_r_Proj(newn, ent_mode, pn_Load_res);
} else {
int offset = get_entity_offset(ent);
......
......@@ -299,8 +299,7 @@ static void copy_parameter_entities(ir_node *call, ir_graph *called_graph)
size_t n_param_pos = get_entity_parameter_number(old_entity);
ir_node *param = get_Call_param(call, n_param_pos);
ir_node *nomem = get_irg_no_mem(irg);
ir_node *sel = new_rd_simpleSel(dbgi, block, nomem, frame, new_ent);
ir_node *sel = new_rd_simpleSel(dbgi, block, frame, new_ent);
ir_node *new_mem;
if (is_aggregate_type(old_type)) {
/* Copy the compound parameter */
......
......@@ -721,7 +721,6 @@ class Sel:
Optimizations assume that a Sel node can only produce a NULL pointer if the
ptr input was NULL."""
ins = [
("mem", "memory dependency"),
("ptr", "pointer to object to select from"),
]
arity = "variable"
......
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