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
What Is a Control Flow Graph?A control flow graph represents a function as basic blocks connected by edges showing every path execution ca…
What Is Common Subexpression Elimination?Common subexpression elimination removes redundant computations by reusing a previously computed result inste…
What Is Register Allocation?Register allocation is the compiler step that decides which program values are kept in fast CPU registers and…