Understanding Compiler Optimization
summary
Explains how GCC turns source into tokens, AST, GIMPLE and SSA and then runs roughly 200–250 optimization passes so the optimizer actually rewrites code; shows using GCC’s opt-record JSON (and an up-mark script) to annotate source with which optimizations ran or were rejected; demonstrates that adding a builtin_unreachable or splitting out code enables tail call optimization, that PGO guides heavy optimizations, and that vectorization requires restrict/no-alias hints (AVX examples) and sometimes manual rewrites to work.
AI-written summary · about
chapters (8)
- 0:00Start
- 2:40The Optimizer
- 3:47Tokenization
- 5:07Abstract Syntax Tree
- 6:04Basic Blocks
- 13:11Versions
- 45:34Built-In Unreachable
- 46:58Vectorization
related talks
15mNot So Fast: Understanding and Mitigating Negative Impacts of Compiler Optimizations on Code Reuse G
01h 25mPeeking Into Your Compiler
10mA quick view into a compiler
33mImproving the Effectiveness and Generality of GCC Auto-Vectorization
58mOptimization Remarks - "Remarks Helping the Compiler Generate Better Code"
01h 04m“Understanding Optimizers: Helping the Compiler Help You”
54mGCC/Clang Optimizations for Embedded Linux
45mA Few Effective gcc/clang Optimizations for Embedded Systems
