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

Method compute

cranelift/codegen/src/loop_analysis.rs:164–173  ·  view source on GitHub ↗

Detects the loops in a function. Needs the control flow graph and the dominator tree.

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

Source from the content-addressed store, hash-verified

162impl LoopAnalysis {
163 /// Detects the loops in a function. Needs the control flow graph and the dominator tree.
164 pub fn compute(&mut self, func: &Function, cfg: &ControlFlowGraph, domtree: &DominatorTree) {
165 let _tt = timing::loop_analysis();
166 self.loops.clear();
167 self.block_loop_map.clear();
168 self.block_loop_map.resize(func.dfg.num_blocks());
169 self.find_loop_headers(cfg, domtree);
170 self.discover_loop_blocks(cfg, domtree);
171 self.assign_loop_levels();
172 self.valid = true;
173 }
174
175 /// Check if the loop analysis is in a valid state.
176 ///

Callers 2

nested_loops_detectionFunction · 0.45
complex_loop_detectionFunction · 0.45

Calls 6

find_loop_headersMethod · 0.80
discover_loop_blocksMethod · 0.80
assign_loop_levelsMethod · 0.80
clearMethod · 0.45
resizeMethod · 0.45
num_blocksMethod · 0.45

Tested by 2

nested_loops_detectionFunction · 0.36
complex_loop_detectionFunction · 0.36