Shrink: Factor accesses of instruction data

This commit is contained in:
Nicolas B. Pierron
2019-08-01 15:08:06 +02:00
committed by Nicolas B. Pierron
parent 3585ee34b0
commit c903735ea8

View File

@@ -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;
}
_ => (),