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

Method compute

cranelift/codegen/src/dominator_tree.rs:350–360  ·  view source on GitHub ↗

Reset and compute a CFG post-order and dominator tree, using Semi-NCA algorithm, described in the paper: Linear-Time Algorithms for Dominators and Related Problems. Loukas Georgiadis, Princeton University, November 2005. The same algorithm is used by Julia, SpiderMonkey and LLVM, the implementation is heavily inspired by them.

(&mut self, func: &Function, cfg: &ControlFlowGraph)

Source from the content-addressed store, hash-verified

348 /// The same algorithm is used by Julia, SpiderMonkey and LLVM,
349 /// the implementation is heavily inspired by them.
350 pub fn compute(&mut self, func: &Function, cfg: &ControlFlowGraph) {
351 let _tt = timing::domtree();
352 debug_assert!(cfg.is_valid());
353
354 self.clear();
355 self.compute_spanning_tree(func);
356 self.compute_domtree(cfg);
357 self.compute_domtree_preorder();
358
359 self.valid = true;
360 }
361
362 /// Clear the data structures used to represent the dominator tree. This will leave the tree in
363 /// a state where `is_valid()` returns false.

Callers 1

with_functionMethod · 0.45

Calls 4

compute_spanning_treeMethod · 0.80
clearMethod · 0.45
compute_domtreeMethod · 0.45

Tested by

no test coverage detected