LLVM IR and Tooling
Purpose
Guide agents through LLVM as a user: generating and inspecting IR, running existing optimisation passes with opt, lowering to assembly with llc, and diagnosing missed optimisations. For writing new LLVM passes (PassPlugin, llvm-lit testing), use skills/compiler-internals/llvm-passes instead.
Triggers
- "Show me the LLVM IR for this function"
- "How do I run an LLVM optimisation pass?"
- "What does this LLVM IR instruction mean?"
- "How do I write a custom LLVM pass?"
- "Why isn't auto-vectorisation happening in LLVM?"
Workflow
1. Generate LLVM IR
2. Run optimisation passes with opt
3. Lower IR to assembly with llc
4. Inspect IR
Key IR constructs to understand:
5. Key passes
6. Debugging missed optimisations
7. Useful llvm tools
For binutils equivalents, see skills/binaries/binutils.
Related skills
- Use
skills/compiler-internals/llvm-passesfor writing and testing custom LLVM passes - Use
skills/compiler-internals/compiler-frontendfor generating LLVM IR from an AST - Use
skills/compiler-internals/jit-compilationfor ORC JIT execution of LLVM IR - Use
skills/compilers/clangfor source-level Clang flags - Use
skills/binaries/linkers-ltofor LTO at link time - Use
skills/profilers/linux-perfcombined withllvm-mcafor micro-architectural analysis


