From 1102290b5f1bc978d63843d7c951f7a6001a77c7 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 21 Jan 2017 23:43:35 +0100 Subject: [PATCH] Wire up REG and NOP properly (so they actually import the right values). --- mach/proto/mcg/pass_instructionselection.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mach/proto/mcg/pass_instructionselection.c b/mach/proto/mcg/pass_instructionselection.c index 8a2277f0d..c9d80b2b0 100644 --- a/mach/proto/mcg/pass_instructionselection.c +++ b/mach/proto/mcg/pass_instructionselection.c @@ -221,10 +221,19 @@ static struct insn* walk_instructions(struct burm_node* node, int goal) case ir_to_esn(IR_NOP, 'F'): case ir_to_esn(IR_NOP, 'L'): case ir_to_esn(IR_NOP, 'D'): - hop_get_value_usage(current_hop, &insn->children[0]->value)->input = true; + { + struct insn* child = insn->children[0]; + struct value* value; + if (child->hop) + value = child->hop->value; + else + value = &child->ir->value; + + hop_get_value_usage(current_hop, value)->input = true; hop_get_value_usage(current_hop, current_hop->value)->output = true; - hop_add_insel(current_hop, "@copy %V %V", &insn->children[0]->value, current_hop->value); + hop_add_insel(current_hop, "@copy %V %V", value, current_hop->value); break; + } } hop_print('I', current_hop); -- 2.34.1