(block: &mut Block, insts: impl IntoIterator<Item = Instruction>)
| 993 | } |
| 994 | |
| 995 | fn insert_opvariables(block: &mut Block, insts: impl IntoIterator<Item = Instruction>) { |
| 996 | let first_non_variable = block |
| 997 | .instructions |
| 998 | .iter() |
| 999 | .position(|inst| inst.class.opcode != Op::Variable); |
| 1000 | let i = first_non_variable.unwrap_or(block.instructions.len()); |
| 1001 | block.instructions.splice(i..i, insts); |
| 1002 | } |
| 1003 | |
| 1004 | fn fuse_trivial_branches(function: &mut Function) { |
| 1005 | let all_preds = compute_preds(&function.blocks); |