From c903735ea8ad9a13bf2b91eb0e5bf2e34eb48d96 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 1 Aug 2019 15:08:06 +0200 Subject: [PATCH] Shrink: Factor accesses of instruction data --- cranelift/codegen/src/binemit/shrink.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cranelift/codegen/src/binemit/shrink.rs b/cranelift/codegen/src/binemit/shrink.rs index 281a93ae31..0f9838c8ab 100644 --- a/cranelift/codegen/src/binemit/shrink.rs +++ b/cranelift/codegen/src/binemit/shrink.rs @@ -33,11 +33,12 @@ pub fn shrink_instructions(func: &mut Function, isa: &dyn TargetIsa) { // // TODO: Eventually, we want the register allocator to avoid leaving these special // instructions behind, but for now, just temporarily avoid trying to shrink them. - match func.dfg[inst] { + let inst_data = &func.dfg[inst]; + match inst_data { InstructionData::RegMove { .. } | InstructionData::RegFill { .. } | InstructionData::RegSpill { .. } => { - divert.apply(&func.dfg[inst]); + divert.apply(inst_data); continue; } _ => (),