Skip to content
Latchkey

What Is a Basic Block?

A basic block is a maximal run of instructions that has a single entry point at the top and a single exit at the bottom, with no branches in or out in between. Once execution enters a basic block, every instruction in it runs in order. Compilers use basic blocks as nodes when building a control flow graph for analysis and optimization.

Why it matters

Because control cannot jump into the middle of a basic block, many optimizations can reason about it as one indivisible unit. It is the fundamental granularity of most compiler dataflow analyses.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →