mohitmishra786/low-level-dev-skills/llvm-ir-and-passes
Claude Code and agent skill by mohitmishra786/low-level-dev-skills
- community
Checking that the SKILL.md file is still in the repository.
LLVM IR and passes skill for reading compiler IR. Use when analyzing LLVM IR, understanding SSA, pass pipeline order, or running opt on bitcode. Activates on queries about LLVM IR, SSA form, opt passes, llvm-dis, pass pipeline, or reading .ll files.
Install
npx vskill@latest install mohitmishra786/low-level-dev-skills/llvm-ir-and-passesSKILL.md
LLVM IR and Passes
Purpose
Teach agents to read and reason about LLVM IR (SSA, types, terminators), navigate the standard pass pipeline, and use opt/llvm-dis for inspection. Complements skills/compilers/llvm (toolchain) and skills/compiler-internals/llvm-passes (writing plugins) — not merged.
When to Use
- Understanding what
-O2changed in generated IR - Triaging miscompiles between Clang versions
- Preparing to write a custom pass
- Teaching SSA and dominance without writing C++ passes yet
Workflow
1. LLVM IR structure
Key concepts: basic blocks, PHI nodes at merges, typed values (i32, ptr, vectors).
2. Emit IR from Clang
3. Standard optimization pipeline (New PM)
Clang -O2 roughly runs:
Inspect with:
4. Useful analysis passes
| Pass | Shows | |
|---|---|---|
-passes=print<domtree> | Dominator tree | |
-passes=print<loops> | Loop nests | |
-passes=print-alias-sets | Alias sets |
5. Reading PHI and UB
undef and poison in IR model LLVM poison semantics — distinct from C UB but related.
6. Compare before/after
7. Agent usage
Common Problems
| Symptom | Cause | Fix | |
|---|---|---|---|
| Pass not found | LLVM version rename | opt --print-passes for your build | |
| IR mismatch | Different LLVM major | Match clang/opt versions | |
| "optnone" blocks opts | -O0 attribute | Compile with -O1+ | |
| Huge IR | Inlined headers | -fno-discard-value-names off; filter function | |
| Wrong pipeline | Legacy vs NPM | Use -passes= syntax |
Related Skills
skills/compilers/llvm— toolchain overviewskills/compiler-internals/llvm-passes— writing PassPluginsskills/compiler-internals/compiler-optimizations-deep— RA and ISelskills/compiler-internals/compiler-frontend— IR generationskills/rust/rustc-basics—rustc --emit=llvm-ir
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/compiler-internals/llvm-ir-and-passes/SKILL.md
Popularity
- Repository stars
- 237
- Repository forks
- 28
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mohitmishra786/low-level-dev-skills/llvm-ir-and-passes)