Refactor matches that used to consume BranchInfo (#5734)

Explicitly borrow the instruction data, and use a mutable borrow to avoid rematch.
This commit is contained in:
Trevor Elliott
2023-02-07 13:29:42 -08:00
committed by GitHub
parent fdd4a778fc
commit 2c8425998b
8 changed files with 24 additions and 50 deletions

View File

@@ -943,7 +943,7 @@ impl<'func, I: VCodeInst> Lower<'func, I> {
let (inst, succ) = self.vcode.block_order().succ_indices(block)[succ_idx];
// Get branch args and convert to Regs.
let branch_args = match self.f.dfg.insts[inst] {
let branch_args = match &self.f.dfg.insts[inst] {
InstructionData::Jump {
destination: block, ..
} => block.args_slice(&self.f.dfg.value_lists),