llvm-passes
Installation
SKILL.md
LLVM Passes
Purpose
Guide agents through writing LLVM optimization passes with the New Pass Manager: FunctionPass and ModulePass structure, PassPluginLibraryInfo registration, running via opt -load-pass-plugin, common analysis utilities (DominatorTree, LoopInfo, AliasAnalysis), IR modification patterns, llvm-lit testing, and debugging with opt -print-after-all.
When to Use
- Adding a custom optimization to an LLVM-based compiler
- Writing an IR transformation pass (inlining, DCE, custom lowering)
- Analyzing control flow with dominator trees or loop info
- Testing passes with FileCheck and llvm-lit
- Debugging pass ordering and IR corruption
- Integrating passes into Clang via plugin