LLVM 22.x tile for building compilers, language runtimes, and out-of-tree tooling
88
83%
Does it follow best practices?
Impact
96%
1.23xAverage score across 5 eval scenarios
Passed
No known issues
Reference: ThinLTO | LLVM Bitcode
LTO defers optimization until link time, when the linker sees more than one translation unit. LLVM represents intermediate code as bitcode (binary LLVM IR). ThinLTO is a scalable variant that uses per-module summaries and a thin link step instead of loading all IR into one huge module first.
.bc) or a mixed object containing bitcode (depending on platform and driver).LLVMgold.so with GNU ld; modern LLD has integrated LTO).Characteristics:
Typical Clang flags:
clang -flto -O2 -c a.c -o a.o
clang -flto -O2 -c b.c -o b.o
clang -flto -O2 a.o b.o -o progUse the same -flto and optimization level across compile and link steps.
.o (or bitcode file) carries a compact summary of its IR: functions, globals, call graph edges, etc.Characteristics:
Typical Clang flags:
clang -flto=thin -O2 -c a.c -o a.o
clang -flto=thin -O2 -c b.c -o b.o
clang -flto=thin -O2 a.o b.o -o progUseful Clang/LLVM tools:
| Tool | Role |
|---|---|
llvm-dis | Disassemble bitcode to .ll text |
llvm-as | Assemble .ll to bitcode |
llvm-nm / llvm-readobj | Inspect objects and LTO sections |
llvm-lto / llvm-lto2 | Stand-alone LTO drivers (advanced) |
Exact tool names and driver integration depend on your LLVM build and platform; verify with your installed clang --help and LLVM 22 release notes.
LLD (ELF, COFF, Mach-O flavors) can run LTO without a separate LLVMgold-style plugin when Clang is built with LLD support:
clang -flto=thin -fuse-ld=lld ...Requirements:
BitWriter component) if you participate in a Clang/LLD-based link—this is uncommon for small tools; most frontends still emit object files via the TargetMachine MC layer.ModulePassManager on a merged Module in memory instead of file-based LTO.hidden, default, and COMDAT behavior affect what the linker can merge and devirtualize.-flto compile with a non-LTO-aware linker without knowing the consequences.llvm-dis on failing modules when diagnosing IR-level LTO bugs.BitWriter, targets)docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
add-alias-analysis
add-attributes-metadata
add-calling-convention
add-debug-info
add-exception-handling
add-gc-statepoints
add-intrinsic
add-lto
add-sanitizer
add-vectorization-hint
frontend-to-ir
jit-setup
lit-filecheck
lower-struct-types
new-target
out-of-tree-setup
tessl-llvm
version-sync