MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / run

Method run

cranelift/codegen/src/egraph/mod.rs:737–765  ·  view source on GitHub ↗

Run the process.

(&mut self)

Source from the content-addressed store, hash-verified

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

Callers 2

egraph_passMethod · 0.45
compileFunction · 0.45

Calls 7

values_and_defsMethod · 0.80
find_reachable_blocksMethod · 0.80
computeMethod · 0.45
containsMethod · 0.45
elaborateMethod · 0.45

Tested by

no test coverage detected