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
Audience: Compiler engineers, language implementers, and tooling authors building on LLVM 22.
Version contract: All content in this tile is pinned to LLVM 22.x (specifically the LLVM 22.1.2 release). API signatures, pass names, header paths, and CMake variables reflect LLVM 22 — not LLVM 19/20/21. When in doubt, verify against the LLVM 22 source or LLVM 22 release notes.
This tile provides three layers of LLVM-specific assistance:
| Layer | Purpose | Files |
|---|---|---|
| Docs | On-demand reference — consult these pages for API details, architecture, and examples | docs/*.md |
| Steering rules | Always-loaded agent guidance — concise rules that shape every LLVM code generation decision | rules/new-programming-language.md |
| Skills | Step-by-step workflows — invoke a skill to execute a specific LLVM task end-to-end | skills/*/SKILL.md |
When to use this tile vs upstream docs:
| Page | What it covers |
|---|---|
| IR Types & Values | Types, constants, metadata, IRBuilder patterns |
| New Pass Manager | NPM architecture, PassBuilder, AnalysisManager, pass pipeline |
| TableGen | TableGen syntax, backends, adding records for registers/instructions/intrinsics |
| Out-of-Tree Projects | CMake setup, find_package(LLVM 22), component linking |
| Code Generation | SelectionDAG, GlobalISel, MachineFunction, TargetMachine |
| Frontend → IR Lowering | AST lowering: expressions, control flow, functions, closures, structs |
| Debug Info (DWARF) | DIBuilder, DISubprogram, DILocalVariable, source locations |
| ORC JIT v2 | LLJIT, LLLazyJIT, ThreadSafeModule, symbol resolution, REPL pattern |
| Exception Handling | invoke, landingpad, personality functions, cleanup/catch |
| GC & Statepoints | gcroot (legacy), gc.statepoint / gc.relocate, StackMap |
| Attributes & Metadata | Function/param attributes, loop hints, branch weights, TBAA, !range |
| Calling Conventions | CallingConv, TableGen CC, CCState / CCValAssign, ABI lowering |
| LTO & ThinLTO | Bitcode, full vs thin link, Clang/LLD flags, summaries |
| Alias Analysis | AliasResult, MemoryLocation, ModRef, TBAA / noalias, custom AA |
| LLVM 22 Version Notes | Breaking changes from LLVM 19/20/21 → 22 |
| Skill | Invoke when... |
|---|---|
add-npm-pass | Adding a new optimization or analysis pass |
out-of-tree-setup | Starting a new compiler/tool project against LLVM 22 |
add-intrinsic | Adding a new llvm.* IR intrinsic |
version-sync | Migrating an existing project to LLVM 22 |
new-target-backend | Adding a new ISA target backend |
frontend-to-ir | Lowering an AST to LLVM IR with IRBuilder |
add-debug-info | Adding DWARF debug info to a frontend |
jit-setup | Setting up ORC JIT v2 for a language runtime or REPL |
lit-filecheck | Writing lit/FileCheck tests for passes, transforms, or codegen |
add-calling-convention | Defining or wiring a calling convention (in-tree target or IR-level ABI) |
add-exception-handling | Adding try/catch/finally with invoke/landingpad and the Itanium ABI |
add-gc-statepoints | Adding GC support: shadow-stack (gcroot) or relocating collector (statepoints) |
add-attributes-metadata | Annotating IR with nounwind/nocapture, loop hints, TBAA, branch weights |
add-lto | Enabling full LTO or ThinLTO for cross-module optimization |
add-alias-analysis | Querying AAResults, emitting noalias/TBAA hints, or writing a custom AA pass |
add-sanitizer | Instrumenting output with ASan, UBSan, or custom runtime checks |
add-vectorization-hint | Guiding the loop vectorizer and SLP vectorizer via loop metadata |
lower-struct-types | Lowering structs, unions, tuples, and nested composites to LLVM IR |
PassInfoMixin, FunctionAnalysisManager, etc.) for all passes.i8*, i32* etc. are gone — only ptr.llvm::Optional removed. Use std::optional / std::nullopt.Triple.h moved to llvm/TargetParser/Triple.h (old llvm/ADT/Triple.h removed).Intrinsic::getDeclaration() removed — use getOrInsertDeclaration() or getDeclarationIfExists().DbgInstPtr return type on DIBuilder::insertDeclare and insertDbgValueIntrinsic — can be Instruction* or DbgRecord*.LLJIT / LLLazyJIT).See version-notes.md for the full migration reference.
AUDIT.md — gap analysis, full skill inventory, and suggested future additions.
In scope:
Out of scope (v0.1.0):
version-notes.md for diff; prior version support planned for a later tile releasedocs
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