Find the set of blocks reachable from the entry block by traversing the current CFG. Must be called after branch simplification and the CFG has been recomputed to reflect post-optimization control flow.
(&self)
| 953 | /// Must be called after branch simplification and the CFG has been |
| 954 | /// recomputed to reflect post-optimization control flow. |
| 955 | fn find_reachable_blocks(&self) -> EntitySet<Block> { |
| 956 | let mut reachable = EntitySet::<Block>::with_capacity(self.func.dfg.num_blocks()); |
| 957 | let entry = self.func.layout.entry_block().unwrap(); |
| 958 | let mut stack = vec![entry]; |
| 959 | reachable.insert(entry); |
| 960 | while let Some(block) = stack.pop() { |
| 961 | for successor in self.cfg.succ_iter(block) { |
| 962 | if reachable.insert(successor) { |
| 963 | stack.push(successor); |
| 964 | } |
| 965 | } |
| 966 | } |
| 967 | reachable |
| 968 | } |
| 969 | |
| 970 | /// Execute a simplification of an instruction in the side-effectful |
| 971 | /// skeleton. |
no test coverage detected