throws_exception = ir_throws_exception(irn);
if (env->call->flags.bits.call_has_imm && is_SymConst(call_ptr)) {
/* direct call */
- low_call = be_new_Call(dbgi, irg, bl, curr_mem, curr_sp, curr_sp,
+ low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp,
+ sp->single_req, curr_sp,
n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs),
n_ins, in, get_Call_type(irn));
be_Call_set_entity(low_call, get_SymConst_entity(call_ptr));
} else {
/* indirect call */
- low_call = be_new_Call(dbgi, irg, bl, curr_mem, curr_sp, call_ptr,
+ low_call = be_new_Call(dbgi, irg, bl, curr_mem, sp->single_req, curr_sp,
+ call->cls_addr->class_req, call_ptr,
n_reg_results + pn_be_Call_first_res + ARR_LEN(destroyed_regs),
n_ins, in, get_Call_type(irn));
}
}
}
- /*
- Set the register class of the call address to
- the backend provided class (default: stack pointer class)
- */
- be_node_set_reg_class_in(low_call, n_be_Call_ptr, call->cls_addr);
-
DBG((dbg, LEVEL_3, "\tcreated backend call %+F\n", low_call));
/* Set the register classes and constraints of the Call parameters. */
#include "irprintf.h"
#include "irgwalk.h"
#include "iropt_t.h"
+#include "irbackedge_t.h"
+#include "irverify_t.h"
#include "be_t.h"
#include "belive_t.h"
}
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)
+ const arch_register_req_t *sp_req, ir_node *sp,
+ const arch_register_req_t *ptr_req, ir_node *ptr,
+ int n_outs, int n, ir_node *in[], ir_type *call_tp)
{
be_call_attr_t *a;
int real_n = n_be_Call_first_arg + n;
a->call_tp = call_tp;
a->pop = 0;
a->base.exc.pin_state = op_pin_state_pinned;
+ be_set_constr_in(irn, n_be_Call_sp, sp_req);
+ be_set_constr_in(irn, n_be_Call_ptr, ptr_req);
return irn;
}
backend_info_t *info;
int i;
- ir_node *phi = new_r_Phi(block, n_ins, ins, mode);
+ ir_node *phi = new_ir_node(NULL, irg, block, op_Phi, mode, n_ins, ins);
+ phi->attr.phi.u.backedge = new_backedge_arr(irg->obst, n_ins);
info = be_get_info(phi);
info->out_infos = NEW_ARR_D(reg_out_info_t, obst, 1);
memset(info->out_infos, 0, 1 * sizeof(info->out_infos[0]));
for (i = 0; i < n_ins; ++i) {
info->in_reqs[i] = req;
}
-
+ irn_verify_irg(phi, irg);
+ phi = optimize_node(phi);
return phi;
}
* @param call_tp the call type of this call
*/
ir_node *be_new_Call(dbg_info *dbg, ir_graph *irg, ir_node *block, ir_node *mem,
- ir_node *sp, ir_node *ptr, int n_outs,
- int n, ir_node *in[], ir_type *call_tp);
+ const arch_register_req_t *sp_req, ir_node *sp,
+ const arch_register_req_t *ptr_req, ir_node *ptr,
+ int n_outs, int n, ir_node *in[], ir_type *call_tp);
/**
* Position numbers for the be_Return inputs.