Run the process.
(&mut self)
| 735 | |
| 736 | /// Run the process. |
| 737 | pub fn run(&mut self) { |
| 738 | self.remove_pure_and_optimize(); |
| 739 | |
| 740 | trace!("egraph built:\n{}\n", self.func.display()); |
| 741 | if cfg!(feature = "trace-log") { |
| 742 | for (value, def) in self.func.dfg.values_and_defs() { |
| 743 | trace!(" -> {} = {:?}", value, def); |
| 744 | match def { |
| 745 | ValueDef::Result(i, 0) => { |
| 746 | trace!(" -> {} = {:?}", i, self.func.dfg.insts[i]); |
| 747 | } |
| 748 | _ => {} |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | // Branch simplification could have mutated the CFG and made some blocks |
| 754 | // unreachable; recompute the CFG, find which blocks are still |
| 755 | // reachable, and remove those that aren't. |
| 756 | self.cfg.compute(self.func); |
| 757 | let reachable_blocks = self.find_reachable_blocks(); |
| 758 | crate::unreachable_code::eliminate_unreachable_code(self.func, self.cfg, |block| { |
| 759 | reachable_blocks.contains(block) |
| 760 | }); |
| 761 | |
| 762 | self.elaborate(); |
| 763 | |
| 764 | log::trace!("stats: {:#?}", self.stats); |
| 765 | } |
| 766 | |
| 767 | /// Remove pure nodes from the `Layout` of the function, ensuring |
| 768 | /// that only the "side-effect skeleton" remains, and also |
no test coverage detected