return frame;
}
+#if 0
/** Dumps the stack layout to file. */
static void stack_layout_dump(FILE *file, be_stack_layout_t *frame)
{
}
}
}
+#endif
/**
* Returns non-zero if the call argument at given position
ir_node *new_alloc;
ir_node *addr;
ir_node *copy;
+ ir_node *ins[2];
foreach_out_edge(alloc, edge) {
ir_node *irn = get_edge_src_irn(edge);
env->call->flags.bits.try_omit_fp = 0;
new_alloc = be_new_AddSP(env->isa->sp, irg, bl, curr_sp, get_Alloc_size(alloc));
- exchange(alloc, new_alloc);
+ if(alloc_mem != NULL) {
+ ir_node *addsp_mem;
+ ir_node *sync;
- if(alloc_mem != NULL)
- set_Proj_proj(alloc_mem, pn_be_AddSP_M);
+ addsp_mem = new_r_Proj(irg, bl, new_alloc, mode_M, pn_be_AddSP_M);
+
+ // We need to sync the output mem of the AddSP with the input mem
+ // edge into the alloc node
+ ins[0] = get_Alloc_mem(alloc);
+ ins[1] = addsp_mem;
+ sync = new_r_Sync(irg, bl, 2, ins);
+
+ exchange(alloc_mem, sync);
+ }
+
+ exchange(alloc, new_alloc);
/* fix projnum of alloca res */
set_Proj_proj(alloc_res, pn_be_AddSP_res);
heights_free(ir_heights);
}
-static void collect_return_walker(ir_node *irn, void *data)
-{
- if(get_irn_opcode(irn) == iro_Return) {
- struct obstack *obst = data;
- obstack_ptr_grow(obst, irn);
- }
-}
-
#if 0 /*
static ir_node *setup_frame(be_abi_irg_t *env)
{
return res;
}
+#if 0
static void create_register_perms(const arch_isa_t *isa, ir_graph *irg, ir_node *bl, pmap *regs)
{
int i, j, n;
obstack_free(&obst, NULL);
}
+#endif
typedef struct {
const arch_register_t *reg;
obstack_free(&env->obst, args);
}
-/**
- * Walker: puts all Alloc(stack_alloc) on a obstack
- */
-static void collect_alloca_walker(ir_node *irn, void *data)
-{
- be_abi_irg_t *env = data;
- if(get_irn_opcode(irn) == iro_Alloc && get_Alloc_where(irn) == stack_alloc)
- obstack_ptr_grow(&env->obst, irn);
-}
-
be_abi_irg_t *be_abi_introduce(be_irg_t *birg)
{
be_abi_irg_t *env = xmalloc(sizeof(env[0]));