Skip to content
STIMSMITH

Basic Block

Concept

A basic block is a maximal straight-line sequence of instructions terminated by a branch instruction, with control flow diverging to one or more successor blocks according to the branch. It is the fundamental structural unit used by reverse-engineering tools (Ghidra), coverage-guided fuzzers (AFL, KCOV), CPU-fuzzing tools (Cascade, HiFuzz), synthetic program-generation preprocessors (Genesis), hardware-assisted fuzzers (SNAP), profile-guided binary optimizers (basic block reordering), and machine-learning hardware performance models (GRANITE).

First seen 6/14/2026
Last seen 7/12/2026
Evidence 20 chunks
Wiki v6

WIKI

Basic Block

Definition

A basic block is a fundamental unit of structured program representation that groups a maximal sequence of instructions executed under straight-line control flow. Across tools the same structural idea is given slightly different phrasings:

READ FULL ARTICLE →

NEIGHBORHOOD

No graph connections found for this entity yet. It may appear in future ingestion runs.

explore full graph →

RELATIONSHIPS

8 connections
Cascade ← uses 100% 4e
Cascade constructs programs as sequences of basic blocks
SNAP ← uses 95% 2e
SNAP uses basic block IDs for edge encoding, leveraging instruction bytes for entropy.
Intermediate Program Construction ← uses 100% 2e
Intermediate program construction builds programs as sequences of basic blocks.
Edge Encoding ← uses 100% 2e
Edge encoding uses pairs of basic block IDs to represent edges in the coverage bitmap.
Basic Block Coverage Tracing ← uses 100% 2e
Basic block coverage tracing records executed basic blocks as coverage units.
TCG-based Instrumentation ← uses 100% 1e
TCG-based instrumentation uses basic blocks as the unit of coverage measurement.
Coverage Tracing ← uses 100% 1e
Coverage tracing counts reached basic blocks and basic block edges to measure code coverage.
Ghidra ← uses 85% 1e
Ghidra displays basic blocks visually in its code analysis interface.

CITATIONS

6 sources
6 citations — click to expand
[1] A basic block consists of a sequence of instructions ending at a branch instruction, and control flow diverges to different successor blocks according to the branch. Coverage-Guided Fuzzing background (Ghidra, Figure 2.1)
[2] AFL distinguishes basic-block transitions; transitions from BB_i to BB_j and from BB_j to BB_i are recorded as separate edges via cur_location XOR prev_location against a shared bitmap. Coverage-Guided Fuzzing background (AFL, Figure 2.2)
[3] KCOV is the Linux kernel's coverage feature for CGF; it relies on GCC/LLVM sanitizer coverage (-fsanitize-coverage) and supports trace-pc (default) and trace-cmp modes, writing output to /sys/kernel/debug/kcov. Coverage-Guided Fuzzing background (KCOV, Section 2.3.2)
[4] KCOV-based coverage measurement is fundamentally designed for single-target fuzzing and is difficult to apply uniformly across independently built components or across software boundaries such as OS-to-firmware. Coverage-Guided Fuzzing background (Section 2.4)
[5] Basic block reordering is a profile-guided binary optimization step; maximizing fall-through branches can be suboptimal for instruction and I-TLB caches, motivating caching-aware algorithms released in BOLT. Improved Basic Block Reordering
[6] GRANITE estimates per-basic-block throughput across microarchitectures using a graph neural network over a graph representation that captures structural and data dependencies between instructions, achieving 6.9% average test error on x86-64. GRANITE: A Graph Neural Network Model for Basic Block Throughput Estimation