IT lexicon › Programming › Irreducible control flow

Irreducible control flow

Programming På svenska → Updated: 2026-11-06

A cycle in the control-flow graph with more than one entry, so there is no single loop header dominating the rest of the loop.

Most loop optimizations assume natural loops: one header that every path in must pass through. A goto straight into the middle of a loop breaks that, and the graph is called irreducible. Frances Allen and John Cocke studied the notion around 1970, and Hecht and Ullman characterized it in 1972: a graph is reducible if it can be collapsed to a single node by repeatedly merging nodes that have one predecessor and deleting self-loops. Structured programming always yields reducible graphs.

In practice they come from hand-written goto, state machines and enthusiastic optimizations such as jump threading. The cure is node splitting — duplicating blocks until every cycle has one entry — which can blow up exponentially in the worst case. WebAssembly only allows structured control flow, so Emscripten and LLVM have to rebuild such graphs before they can be translated at all.

← Back to the lexicon