Remove a previously declared Block predecessor by giving a reference to the jump instruction. Returns the basic block containing the instruction. Note: use only when you know what you are doing, this might break the SSA building problem
(&mut self, block: Block, inst: Inst)
| 415 | /// |
| 416 | /// Note: use only when you know what you are doing, this might break the SSA building problem |
| 417 | pub fn remove_block_predecessor(&mut self, block: Block, inst: Inst) { |
| 418 | debug_assert!(!self.is_sealed(block)); |
| 419 | let data = &mut self.ssa_blocks[block]; |
| 420 | let pred = data |
| 421 | .predecessors |
| 422 | .as_slice(&self.inst_pool) |
| 423 | .iter() |
| 424 | .position(|&branch| branch == inst) |
| 425 | .expect("the predecessor you are trying to remove is not declared"); |
| 426 | data.predecessors.swap_remove(pred, &mut self.inst_pool); |
| 427 | } |
| 428 | |
| 429 | /// Completes the global value numbering for a `Block`, all of its predecessors having been |
| 430 | /// already sealed. |
no test coverage detected