Skip to main content

detect_loops

Function detect_loops 

Source
pub fn detect_loops(blocks: &[LoopBlock]) -> Vec<LoopInfo>
Expand description

Detect loops in a CFG using Y-coordinate clustering

Blocks with Y > 0 are inside loops. Blocks with the same Y value at non-zero levels are grouped together as belonging to the same loop nesting depth.

§Arguments

  • blocks - Slice of CFG blocks with spatial coordinates

§Returns

Vector of LoopInfo for each detected loop level