Commit 202f008f authored by Christoph Mallon's avatar Christoph Mallon
Browse files

be: Remove frame input from MemPerm.

parent 6e0675a0
......@@ -225,7 +225,7 @@ static void transform_MemPerm(ir_node *node)
ir_type *enttype = get_entity_type(inent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(outent));
ir_node *mem = get_irn_n(node, i + 1);
ir_node *mem = get_irn_n(node, i);
ir_node *push;
/* work around cases where entities have different sizes */
......
......@@ -202,19 +202,10 @@ 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_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;
ir_graph *const irg = get_irn_irg(block);
ir_node *const irn = new_ir_node(NULL, irg, block, op_be_MemPerm, mode_T, n, in);
ir_node **real_in = ALLOCAN(ir_node*, n + 1);
real_in[0] = frame;
MEMCPY(&real_in[1], in, n);
ir_node *irn = new_ir_node(NULL, irg, block, op_be_MemPerm, mode_T, n+1, real_in);
init_node_attr(irn, n + 1, n, arch_irn_flags_none);
be_node_set_reg_class_in(irn, 0, sp->cls);
init_node_attr(irn, n, n, arch_irn_flags_none);
be_memperm_attr_t *attr = (be_memperm_attr_t*)get_irn_generic_attr(irn);
attr->in_entities = OALLOCNZ(get_irg_obstack(irg), ir_entity*, n);
......@@ -382,7 +373,7 @@ int be_get_MemPerm_offset(const ir_node *irn)
unsigned be_get_MemPerm_entity_arity(const ir_node *irn)
{
assert(be_is_MemPerm(irn));
return get_irn_arity(irn) - 1;
return get_irn_arity(irn);
}
const arch_register_req_t *be_create_reg_req(struct obstack *obst,
......
......@@ -379,8 +379,8 @@ static void collect_memperm(be_verify_spillslots_env_t *env, ir_node *node, ir_n
int arity = be_get_MemPerm_entity_arity(memperm);
for (int i = 0; i < arity; ++i) {
ir_node* arg = get_irn_n(memperm, i + 1);
ir_entity* argent = be_get_MemPerm_in_entity(memperm, i);
ir_node *const arg = get_irn_n(memperm, i);
ir_entity *const argent = be_get_MemPerm_in_entity(memperm, i);
collect(env, arg, memperm, argent);
}
......
......@@ -884,7 +884,7 @@ static void transform_MemPerm(ir_node *node)
ir_type *enttype = get_entity_type(inent);
unsigned entsize = get_type_size_bytes(enttype);
unsigned entsize2 = get_type_size_bytes(get_entity_type(outent));
ir_node *mem = get_irn_n(node, i + 1);
ir_node *mem = get_irn_n(node, i);
/* work around cases where entities have different sizes */
if (entsize2 < entsize)
......
......@@ -718,7 +718,7 @@ static ir_node *find_original_value(ir_node *node)
if (be_is_Perm(pred)) {
return find_original_value(get_irn_n(pred, get_Proj_num(node)));
} else if (be_is_MemPerm(pred)) {
return find_original_value(get_irn_n(pred, get_Proj_num(node) + 1));
return find_original_value(get_irn_n(pred, get_Proj_num(node)));
} else if (is_ia32_Load(pred)) {
return find_original_value(get_irn_n(pred, n_ia32_Load_mem));
} else if (is_ia32_Store(pred)) {
......
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