static void constrain_output_reg(int attr)
{
+ struct vreg* vreg = current_hop->output;
+
+ if (!vreg)
+ current_hop->output = vreg = new_vreg();
+
+ array_appendu(¤t_hop->outs, vreg);
+ vreg->defined = current_hop;
}
static const struct burm_emitter_data emitter_data =
case ir_to_esn(IR_NOP, 0):
vreg = node->left->ir->result;
break;
-
- default:
- /* FIXME: some instructions don't emit anything, so
- * allocating a register for them is a waste of time. */
- vreg = new_vreg();
}
insn->hop = current_hop = new_hop(current_bb, insn->ir);
- insn->hop->output = vreg;
- if (vreg)
- {
- array_appendu(¤t_hop->outs, vreg);
- vreg->defined = current_hop;
- }
-
+ current_hop->output = vreg;
emit(insn);
+
hop_print('I', current_hop);
array_append(¤t_bb->hops, current_hop);