How llvm/llvm-project works
LLVM BOLT is a post-link binary optimizer: a user supplies an executable and, commonly, profile data; BOLT analyzes and optimizes the binary, then emits a rewritten executable. The tree shows distinct profile handling, binary representation, optimization passes, rewriting, and instrumentation runtime capabilities. The sampled evidence is limited: the source index exposes the pass manager’s pass references, while other workflow connections are architectural context from the tree and remain dashed and uncited rather than asserted as inspected calls.
Main entry points: llvm-bolt.cpp BOLT driver · BinaryPassManager.cpp Pass manager · RewriteInstance.cpp Executable rewriting · Profile Profile readers
Components 19
Inputs and profiles
- Input executable
- Profile data
bolt/lib/Profile - Profile readers
bolt/lib/Profile
Binary analysis
- Binary context
bolt/lib/Core/BinaryContext.cpp - Binary functions
bolt/lib/Core/BinaryFunction.cpp - Profile aggregation
bolt/lib/Profile/DataAggregator.cpp
Optimization
- Pass manager
bolt/lib/Rewrite/BinaryPassManager.cpp - Layout and reordering
bolt/lib/Passes/ReorderFunctions.cpp - Inlining and folding
bolt/lib/Passes/Inliner.cpp - Instrumentation passes
bolt/lib/Passes/Instrumentation.cpp - Analysis passes
bolt/lib/Passes/DataflowAnalysis.cpp
Rewrite and runtime
- BOLT driver
bolt/tools/driver/llvm-bolt.cpp - Binary emitter
bolt/lib/Core/BinaryEmitter.cpp - Executable rewriting
bolt/lib/Rewrite/RewriteInstance.cpp - Metadata rewriting
bolt/lib/Rewrite/DWARFRewriter.cpp - Instrumentation runtime
bolt/runtime/instr.cpp - Rewritten executable
- Hugify runtime
bolt/runtime/hugify.cpp
Other components
- BOLT user
Connections 17
- BOLT user → BOLT driver: invokes
- Input executable → BOLT driver: provides input
- Profile data → Profile readers: read by
- BOLT driver → Binary context: analyzes through
- Binary context → Binary functions: models
- Profile readers → Profile aggregation: aggregates into
- BOLT driver → Pass manager: runs passes
- Pass manager → Layout and reordering: dispatches
bolt/lib/Rewrite/BinaryPassManager.cpp - Pass manager → Inlining and folding: dispatches
bolt/lib/Rewrite/BinaryPassManager.cpp - Pass manager → Instrumentation passes: dispatches
bolt/lib/Rewrite/BinaryPassManager.cpp - Pass manager → Analysis passes: dispatches
bolt/lib/Rewrite/BinaryPassManager.cpp - BOLT driver → Executable rewriting: rewrites through
- Executable rewriting → Binary emitter: emits via
- Executable rewriting → Metadata rewriting: rewrites metadata
- Binary emitter → Rewritten executable: writes
- Instrumentation passes → Instrumentation runtime: uses
- BOLT driver → Hugify runtime: may include