LLVM Internals Series: Writing a Simple LLVM Pass From Scratch
sh4dy_0011 · x · 2026-10-11
Author sh4dy publishes the first part of a "Learning LLVM" series on how to write LLVM passes.
- What LLVM is: a collection of modular, reusable compiler and toolchain technologies, serving as the backend for Rust and Swift, and used for JIT compilation, static/dynamic analysis, shader compilation and more.
- Three-stage compiler structure: the frontend turns source code into a language- and target-independent intermediate representation (IR); the middle-end applies target-independent optimizations on the IR; the backend lowers optimized IR to target-specific machine or assembly code with target-specific optimizations.
- Passes: passes are LLVM's modular processing units; the post walks through writing a simple pass that prints function names.
The series has four parts, with later installments going deeper into compiler and LLVM internals.
More from coding & agent
- Dev has Claude write 6,000 lines of Go with zero mistakes for a secrets proxy — andersonbcdefg · 2026-10-11
- Portfolio vs. real work: are most agents built to be used or just to be shown? — Luvena21 · 2026-10-11
- LoreKit: open-source deterministic memory layer for coding agents, no vector index — madsthines · 2026-10-11
- Devs push back on AI slop panic: codebases have always contained human-made slop — ctjlewis · 2026-10-11
- Shrike: open-source MCP server that gives Claude Code a recording of your app's crash — S_m_nt · 2026-10-11
- Grok agent gets its own email and proactivity, winning back skeptical users — Baconbrix · 2026-10-11