How Compilers Work: Introduction to LLVM Passes
summary
Step‑by‑step C++ shows how to implement, CMake and register an out-of-tree plugin for opt, including the minimal "hello world" pass that prints each function name and argument count and can be scheduled twice from the command line. It builds a real transformation that replaces 8-bit adds with an equivalent MB-algebra sequence, verifies correctness with lli (example returns 10) and reports 3 replacements via opt stats, and it builds a standalone analysis tool (static call counter), plus LIT-based tests from the llvm-tutor repo.
AI-written summary · about
chapters (8)
- 0:00LLVM and passes intro
- 3:18Setting up LLVM env
- 12:19Hello world LLVM pass
- 23:24Transformation pass
- 34:21Analysis tool
- 43:35Testing passes with Lit
- 49:34Debugging LLVM tips
- 51:40Q&A
related talks
52mUnderstanding Compiler Optimization
24mCompilers and LLVM Demystified
20mLet's Build a Computation-Graph JIT Compiler in C++
53mFrom Within: Compiler Testing and Validation via Compilers
32mGetting started with LLVM using Swift
53mLLVM
10mA quick view into a compiler
01h 04mJust-in-Time Compilation: The Next Big Thing?
