make unique types/entities part of irprog
[libfirm] / ir / be / benode.c
index decc044..af54ed2 100644 (file)
@@ -358,8 +358,19 @@ ir_node *be_new_Perm(const arch_register_class_t *cls, ir_node *block,
        attr                = (be_node_attr_t*) get_irn_generic_attr(irn);
        attr->exc.pin_state = op_pin_state_pinned;
        for (i = 0; i < n; ++i) {
-               be_node_set_reg_class_in(irn, i, cls);
-               be_node_set_reg_class_out(irn, i, cls);
+               const ir_node             *input = in[i];
+               const arch_register_req_t *req   = arch_get_irn_register_req(input);
+               if (req->width == 1) {
+                       be_set_constr_in(irn, i, cls->class_req);
+                       be_set_constr_out(irn, i, cls->class_req);
+               } else {
+                       arch_register_req_t *new_req = allocate_reg_req(irn);
+                       new_req->cls   = cls;
+                       new_req->type  = (req->type & arch_register_req_type_aligned);
+                       new_req->width = req->width;
+                       be_set_constr_in(irn, i, new_req);
+                       be_set_constr_out(irn, i, new_req);
+               }
        }
 
        return irn;
@@ -1332,7 +1343,8 @@ void be_init_op(void)
        op_be_Keep      = new_ir_op(beo_Keep,      "be_Keep",      op_pin_state_exc_pinned, irop_flag_keep,                          oparity_dynamic,  0, sizeof(be_node_attr_t),    &be_node_op_ops);
        op_be_CopyKeep  = new_ir_op(beo_CopyKeep,  "be_CopyKeep",  op_pin_state_exc_pinned, irop_flag_keep,                          oparity_variable, 0, sizeof(be_node_attr_t),    &be_node_op_ops);
        op_be_Call      = new_ir_op(beo_Call,      "be_Call",      op_pin_state_exc_pinned, irop_flag_fragile|irop_flag_uses_memory, oparity_variable, 0, sizeof(be_call_attr_t),    &be_node_op_ops);
-       ir_op_set_fragile_indices(op_be_Call, n_be_Call_mem, pn_be_Call_X_regular, pn_be_Call_X_except);
+       ir_op_set_memory_index(op_be_Call, n_be_Call_mem);
+       ir_op_set_fragile_indices(op_be_Call, pn_be_Call_X_regular, pn_be_Call_X_except);
        op_be_Return    = new_ir_op(beo_Return,    "be_Return",    op_pin_state_exc_pinned, irop_flag_cfopcode,                      oparity_dynamic,  0, sizeof(be_return_attr_t),  &be_node_op_ops);
        op_be_AddSP     = new_ir_op(beo_AddSP,     "be_AddSP",     op_pin_state_exc_pinned, irop_flag_none,                          oparity_unary,    0, sizeof(be_node_attr_t),    &be_node_op_ops);
        op_be_SubSP     = new_ir_op(beo_SubSP,     "be_SubSP",     op_pin_state_exc_pinned, irop_flag_none,                          oparity_unary,    0, sizeof(be_node_attr_t),    &be_node_op_ops);