diff --git a/mach/proto/mcg/pass_instructionselection.c b/mach/proto/mcg/pass_instructionselection.c index 20a93c697..48ede30df 100644 --- a/mach/proto/mcg/pass_instructionselection.c +++ b/mach/proto/mcg/pass_instructionselection.c @@ -129,8 +129,24 @@ static struct insn* walk_instructions(struct burm_node* node, int goal) if (!insn->insndata->is_fragment) { + struct vreg* vreg = NULL; + + switch (node->label) + { + case ir_to_esn(IR_REG, 0): + vreg = node->ir->result; + break; + + case ir_to_esn(IR_NOP, 0): + vreg = node->left->ir->result; + break; + + default: + vreg = new_vreg(); + } + insn->hop = current_hop = new_hop(0, insn->ir); - insn->hop->output = new_vreg(); + insn->hop->output = vreg; emit(insn); hop_print('I', current_hop); diff --git a/mach/proto/mcg/table b/mach/proto/mcg/table index 0fa07b6bc..4d892c069 100644 --- a/mach/proto/mcg/table +++ b/mach/proto/mcg/table @@ -69,11 +69,9 @@ PATTERNS cost 4; reg = in:REG - emit "mov %reg, %in" cost 1; reg = NOP(in:reg) - emit "mov %reg, %in" cost 1;