llvm-backend-generator
Skill17 starsChanged 9 months agoApache-2.0View on GitHub
Generates LLVM IR and builds compilers targeting LLVM. Use when: (1)
In this repository98 other files it gives its agents.
- abstract-interpretation-engineSkill
- abstract-machineSkill
- acsl-annotation-assistantSkill
- actor-model-implementerSkill
- algebraic-effectsSkill
- alias-and-points-to-analysisSkill
- axiomatic-semanticsSkill
- bidirectional-type-checkingSkill
- bisimulation-checkerSkill
- capability-systemSkill
- closure-converterSkill
- common-subexpression-eliminatorSkill
- concurrency-verifierSkill
- constant-propagation-passSkill
- contextual-equivalenceSkill
- control-flow-analysisSkill
- coq-proof-assistantSkill
- cps-transformerSkill
- dafny-verifierSkill
- dataflow-analysis-frameworkSkill
- dead-code-eliminatorSkill
- defunctionalizationSkill
- denotational-semantics-builderSkill
- dependent-type-implementerSkill
- dsl-embeddingSkill
- effect-handlers-implementerSkill
- effect-systemSkill
- effect-type-systemSkill
- escape-analysisSkill
- existential-typesSkill
- ffi-designerSkill
- fuzzer-generatorSkill
- gadt-implementerSkill
- garbage-collector-implementerSkill
- graalvm-truffle-implementerSkill
- gradual-typing-implementerSkill
- higher-order-abstract-syntaxSkill
- hoare-logic-verifierSkill
- incremental-computationSkill
- information-flow-analyzerSkill
- inline-expanderSkill
- interprocedural-analysisSkill
- invariant-generatorSkill
- jit-compiler-builderSkill
- lambda-calculus-interpreterSkill
- language-server-protocolSkill
- lean-proverSkill
- lexer-generatorSkill
- linear-type-implementerSkill
- liveness-analysisSkill
- lock-free-data-structureSkill
- loop-optimizerSkill
- loop-termination-proverSkill
- macro-expanderSkill
- memory-allocatorSkill
- message-passing-systemSkill
- mlir-dialect-designerSkill
- model-checkerSkill
- module-systemSkill
- monad-transformerSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 60
Use existing language frontends (Clang, Swift) as reference
- Distinctive: line 63
Use debug info metadata for debugging support
- Distinctive: line 64
Consider embedded languages (Emscripten, Rust)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LLVM Backend Generator
Generates LLVM Intermediate Representation (IR) and builds compiler backends targeting LLVM.
When to Use
- Building compilers for new languages
- Implementing language backends
- Creating optimization pipelines
- Generating native code
- Integrating with existing LLVM-based tools
What This Skill Does
- Generates LLVM IR - Creates valid LLVM bitcode
- Builds instruction selection - Patterns for code generation
- Implements optimization passes - Built-in and custom passes
- Handles ABI - Calling conventions, data layout
Key Concepts
| Concept | Description |
| LLVM IR | Three-address code, SSA form |
| Basic block | Sequence of instructions, single entry/exit |
| SSA | Static Single Assignment - each variable assigned once |
| Pass | Transformation or analysis |
| Target triple | CPU/OS/platform combination |
Optimization Pass Categories
| Category | Passes |
| Analysis | Dominators, loop info, alias analysis |
| Transforms | GVN, LICM, inlining, vectorization |
| CodeGen | Instruction selection, register allocation |
Tips
- Use existing language frontends (Clang, Swift) as reference
- Implement proper name mangling for C++ interop
- Handle alignment and endianness correctly
- Use debug info metadata for debugging support
- Consider embedded languages (Emscripten, Rust)
Related Skills
jit-compiler-builder- JIT with LLVM ORCssa-constructor- SSA form constructiontype-checker-generator- Type checking frontenddataflow-analysis-framework- Analysis passes
Canonical References
| Reference | Why It Matters |
| Lattner & Adve, "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation" (CGO 2004) | LLVM design |
| The LLVM Language Reference | IR specification |
| LLVM Documentation | Official docs and tutorials |
| Kaleidoscope Tutorial | Building a language with LLVM |
Tradeoffs and Limitations
Approaches
| Approach | Pros | Cons |
| Use LLVM API | Full control, optimized | Complex API |
| Use MCJIT/ORC | Easier JIT | Less control |
| Emit textual IR | Simple, debuggable | Slower |
Limitations
- Complex API learning curve
- Generated code quality depends on patterns
- Limited portability without target description
- Some targets less mature than x86/AArch64
Research Tools & Artifacts
LLVM-based compilers:
| Tool | What to Learn |
| Clang | C/C++ frontend |
| Rust | Rust compiler |
| Swift | Swift compiler |
Research Frontiers
1. WASM Compilation
- Goal: WebAssembly targets
Implementation Pitfalls
| Pitfall | Real Consequence | Solution |
| Target bugs | Wrong code | Test extensively |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

