How llvm-mirror/llvm works
LLVM is a compiler infrastructure toolkit: clients construct or parse LLVM IR, analyze and optimize it, then lower it for a target or execute it through an interpreter/JIT. The tree also exposes language bindings and specialized tools for machine-code analysis and IR comparison. The README establishes the toolkit’s broad purpose; the sampled implementation is limited, so edges describe documented subsystem responsibilities rather than uninspected internal call chains.
Main entry points: Core.h IR API · PassManagerBuilder.h Pass manager · TargetMachine.h Target machine · Passes.h Machine codegen
Components 21
IR and Inputs
- IR API
include/llvm-c/Core.h - IR parser
include/llvm/AsmParser/Parser.h - Bitcode reader
include/llvm-c/BitReader.h - Bitcode writer
include/llvm-c/BitWriter.h
Analysis and Transforms
- IR analysis
include/llvm/Analysis/Passes.h - Pass manager
include/llvm-c/Transforms/PassManagerBuilder.h - Scalar transforms
include/llvm-c/Transforms/Scalar.h - IPO transforms
include/llvm-c/Transforms/IPO.h - Vectorization
include/llvm-c/Transforms/Vectorize.h
Codegen and Runtime
- Target machine
include/llvm-c/TargetMachine.h - Machine codegen
include/llvm/CodeGen/Passes.h - Execution engine API
include/llvm/ExecutionEngine/ExecutionEngine.h - Execution engine
lib/ExecutionEngine/ExecutionEngine.cpp - Loop pipeliner
lib/CodeGen/MachinePipeliner.cpp
Bindings and Tools
- Go bindings
bindings/go/llvm/ir.go - OCaml bindings
bindings/ocaml/llvm/llvm_ocaml.c - Python bindings
bindings/python/llvm/core.py - MCA pipeline
lib/MCA/Pipeline.cpp - MCA reporting
tools/llvm-mca/PipelinePrinter.h - IR comparison
tools/llvm-diff/DifferenceEngine.cpp
Other components
- Compiler client
Connections 23
- Compiler client → IR API: builds IR
- Compiler client → IR parser: parses IR
- Compiler client → Bitcode reader: reads bitcode
- IR API → Bitcode writer: writes bitcode
- IR API → IR analysis: analyzes IR
- IR API → Pass manager: configures passes
- Pass manager → Scalar transforms: runs passes
- Pass manager → IPO transforms: runs passes
- Pass manager → Vectorization: runs passes
- IR API → Target machine: provides module
- Target machine → Machine codegen: lowers for target
- IR API → Execution engine API: provides module
- Execution engine API → Execution engine: creates or invokes
- Machine codegen → Loop pipeliner: schedules loops
- Compiler client → Go bindings: uses
- Compiler client → OCaml bindings: uses
- Compiler client → Python bindings: uses
- Go bindings → IR API: wraps C API
- OCaml bindings → IR API: wraps C API
- Python bindings → IR API: exposes IR
- Compiler client → MCA pipeline: analyzes machine code
- MCA pipeline → MCA reporting: reports cycles
- Compiler client → IR comparison: compares modules