This one's for when you're working directly with LLVM's intermediate representation, not just compiling through it. You'll reach for it when you need to inspect IR, run specific opt passes to see what's happening between source and assembly, or debug why a loop didn't vectorize. It covers the whole pipeline: generating IR with clang, running transformations with opt, lowering to assembly with llc, and reading the IR constructs themselves. The pass reference is solid, mem2reg through loop-vectorize, and the debugging section on missed optimizations is exactly what you need when performance isn't what you expected. If you're doing compiler work, writing custom passes, or just trying to understand what your optimizer is actually doing, this gets you there without wandering through documentation.
- skills.sh installs
- 948
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill llvm --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
# Emit textual IR (.ll)
clang -O0 -emit-llvm -S src.c -o src.ll
# Emit bitcode (.bc)
clang -O2 -emit-llvm -c src.c -o src.bc
# Disassemble bitcode to text
llvm-dis src.bc -o src.ll
2. Run optimisation passes with opt
# Apply a specific pass
opt -passes='mem2reg,instcombine,simplifycfg' src.ll -S -o out.ll
# Standard optimisation pipelines
opt -passes='default<O2>' src.ll -S -o out.ll
opt -passes='default<O3>' src.ll -S -o out.ll
# List available passes
opt --print-passes 2>&1 | less
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Categories
- Backend & APIs, DevOps & CI/CD, Documentation, Automation & Workflows, Sales & Marketing
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Sanitizers895
- Core Dumps828
- Linux Perf814
- Clang789
- Cross Gcc742
- Gcc741
- Valgrind740
- Flamegraphs728
- Assembly X86724
- Strace Ltrace711
- Cpu Cache Opt709
- Assembly Arm707
- Lldb703
- Elf Inspection702
- Simd Intrinsics701
- Make697
- Memory Model693
- Freertos691
- Linux Kernel Modules689
- Ninja681
- Heaptrack676
- Rust Profiling673
- Ebpf672
- Msvc Cl671
