+ir_node *be_new_Call(dbg_info *dbg, ir_graph *irg, ir_node *bl, ir_node *mem, ir_node *sp, ir_node *ptr,
+ int n_outs, int n, ir_node *in[], ir_type *call_tp)
+{
+ be_call_attr_t *a;
+ int real_n = be_pos_Call_first_arg + n;
+ ir_node *irn;
+ ir_node **real_in;
+
+ NEW_ARR_A(ir_node *, real_in, real_n);
+ real_in[be_pos_Call_mem] = mem;
+ real_in[be_pos_Call_sp] = sp;
+ real_in[be_pos_Call_ptr] = ptr;
+ memcpy(&real_in[be_pos_Call_first_arg], in, n * sizeof(in[0]));
+
+ irn = new_ir_node(NULL, irg, bl, op_be_Call, mode_T, real_n, real_in);
+ a = init_node_attr(irn, (n_outs > real_n ? n_outs : real_n));
+ a->ent = NULL;
+ a->call_tp = call_tp;
+ return irn;
+}
+
+/* Gets the call entity or NULL if this is no static call. */
+entity *be_Call_get_entity(const ir_node *call) {
+ be_call_attr_t *a = get_irn_attr(call);
+ assert(be_is_Call(call));
+ return a->ent;
+}
+
+/* Sets the call entity. */
+void be_Call_set_entity(ir_node *call, entity *ent) {
+ be_call_attr_t *a = get_irn_attr(call);
+ assert(be_is_Call(call));
+ a->ent = ent;
+}
+
+/* Gets the call type. */
+ir_type *be_Call_get_type(ir_node *call) {
+ be_call_attr_t *a = get_irn_attr(call);
+ assert(be_is_Call(call));
+ return a->call_tp;
+}
+
+/* Sets the call type. */
+void be_Call_set_type(ir_node *call, ir_type *call_tp) {
+ be_call_attr_t *a = get_irn_attr(call);
+ assert(be_is_Call(call));
+ a->call_tp = call_tp;
+}
+
+
+ir_node *be_new_Return(dbg_info *dbg, ir_graph *irg, ir_node *bl, int n, ir_node *in[])
+{
+ ir_node *irn = new_ir_node(dbg, irg, bl, op_be_Return, mode_X, n, in);
+ init_node_attr(irn, n);
+
+ return irn;
+}
+
+ir_node *be_new_IncSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *mem, unsigned offset, be_stack_dir_t dir)
+{
+ be_stack_attr_t *a;
+ ir_node *irn;
+ ir_node *in[1];
+
+ in[0] = old_sp;
+ in[1] = mem;
+ irn = new_ir_node(NULL, irg, bl, op_be_IncSP, sp->reg_class->mode, 2, in);
+ a = init_node_attr(irn, 1);
+ a->dir = dir;
+ a->offset = offset;
+
+ be_node_set_flags(irn, -1, arch_irn_flags_ignore);
+
+ /* Set output constraint to stack register. */
+ be_node_set_reg_class(irn, 0, sp->reg_class);
+ be_set_constr_single_reg(irn, -1, sp);
+ be_node_set_irn_reg(NULL, irn, sp);
+
+ return irn;
+}
+
+ir_node *be_new_AddSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *sz)
+{
+ be_node_attr_t *a;
+ ir_node *irn;
+ ir_node *in[be_pos_AddSP_last];
+
+ in[be_pos_AddSP_old_sp] = old_sp;
+ in[be_pos_AddSP_size] = sz;
+
+ irn = new_ir_node(NULL, irg, bl, op_be_AddSP, mode_T, be_pos_AddSP_last, in);
+ a = init_node_attr(irn, be_pos_AddSP_last);
+
+ be_node_set_flags(irn, OUT_POS(0), arch_irn_flags_ignore);
+
+ /* Set output constraint to stack register. */
+ be_set_constr_single_reg(irn, OUT_POS(0), sp);
+
+ return irn;
+}
+
+ir_node *be_new_SetSP(const arch_register_t *sp, ir_graph *irg, ir_node *bl, ir_node *old_sp, ir_node *op, ir_node *mem)
+{
+ be_node_attr_t *a;
+ ir_node *irn;
+ ir_node *in[3];
+
+ in[0] = mem;
+ in[1] = old_sp;
+ in[2] = op;
+ irn = new_ir_node(NULL, irg, bl, op_be_SetSP, get_irn_mode(old_sp), 3, in);
+ a = init_node_attr(irn, 3);
+
+ be_node_set_flags(irn, OUT_POS(0), arch_irn_flags_ignore);
+
+ /* Set output constraint to stack register. */
+ be_set_constr_single_reg(irn, OUT_POS(0), sp);
+ be_node_set_reg_class(irn, 1, sp->reg_class);
+ be_node_set_reg_class(irn, 2, sp->reg_class);
+ be_node_set_irn_reg(NULL, irn, sp);
+
+ return irn;
+}
+
+ir_node *be_new_StackParam(const arch_register_class_t *cls, const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_mode *mode, ir_node *frame_pointer, entity *ent)
+{
+ be_frame_attr_t *a;
+ ir_node *irn;
+ ir_node *in[1];
+
+ in[0] = frame_pointer;
+ irn = new_ir_node(NULL, irg, bl, op_be_StackParam, mode, 1, in);
+ a = init_node_attr(irn, 1);
+ a->ent = ent;
+
+ be_node_set_reg_class(irn, 0, cls_frame);
+ be_node_set_reg_class(irn, OUT_POS(0), cls);
+ return irn;
+}
+
+ir_node *be_new_RegParams(ir_graph *irg, ir_node *bl, int n_outs)
+{
+ ir_node *irn;
+ ir_node *in[1];
+
+ irn = new_ir_node(NULL, irg, bl, op_be_RegParams, mode_T, 0, in);
+ init_node_attr(irn, n_outs);
+ return irn;
+}
+
+ir_node *be_new_FrameLoad(const arch_register_class_t *cls_frame, const arch_register_class_t *cls_data,
+ ir_graph *irg, ir_node *bl, ir_node *mem, ir_node *frame, entity *ent)
+{
+ be_frame_attr_t *a;
+ ir_node *irn;
+ ir_node *in[2];
+
+ in[0] = mem;
+ in[1] = frame;
+ irn = new_ir_node(NULL, irg, bl, op_be_FrameLoad, mode_T, 2, in);
+ a = init_node_attr(irn, 3);
+ a->ent = ent;
+ a->offset = 0;
+ be_node_set_reg_class(irn, 1, cls_frame);
+ be_node_set_reg_class(irn, OUT_POS(pn_Load_res), cls_data);
+ return irn;
+}
+
+ir_node *be_new_FrameStore(const arch_register_class_t *cls_frame, const arch_register_class_t *cls_data,
+ ir_graph *irg, ir_node *bl, ir_node *mem, ir_node *frame, ir_node *data, entity *ent)
+{
+ be_frame_attr_t *a;
+ ir_node *irn;
+ ir_node *in[3];
+
+ in[0] = mem;
+ in[1] = frame;
+ in[2] = data;
+ irn = new_ir_node(NULL, irg, bl, op_be_FrameStore, mode_T, 3, in);
+ a = init_node_attr(irn, 3);
+ a->ent = ent;
+ a->offset = 0;
+ be_node_set_reg_class(irn, 1, cls_frame);
+ be_node_set_reg_class(irn, 2, cls_data);
+ return irn;
+}
+
+ir_node *be_new_FrameAddr(const arch_register_class_t *cls_frame, ir_graph *irg, ir_node *bl, ir_node *frame, entity *ent)
+{
+ be_frame_attr_t *a;
+ ir_node *irn;
+ ir_node *in[1];
+
+ in[0] = frame;
+ irn = new_ir_node(NULL, irg, bl, op_be_FrameAddr, get_irn_mode(frame), 1, in);
+ a = init_node_attr(irn, 1);
+ a->ent = ent;
+ a->offset = 0;
+ be_node_set_reg_class(irn, 0, cls_frame);
+ be_node_set_reg_class(irn, OUT_POS(0), cls_frame);
+ return irn;
+}
+
+ir_node *be_new_CopyKeep(const arch_register_class_t *cls, ir_graph *irg, ir_node *bl, ir_node *src, int n, ir_node *in_keep[], ir_mode *mode)