Understanding Compiler Optimization
summary
Claim: understanding performance means understanding optimizers, because compilers do the real collapsing of C++ abstractions. Examples and tools are concrete: LLVM IR with SSA and PHI nodes (SSA obviates roughly 80–90% of classic data‑flow hacks), a bottom‑up inliner on SCCs that still misses hard variadic cases, and loop canonicalization and vectorization (unrolling, widening, legality checks, poly project). Practical build tools include UBSan and LTO; some passes work well, others (phase ordering, cross‑TU scaling) still fail in real builds.
AI-written summary · about
chapters (11)
- 0:00Compiler optimization intro
- 3:59How compilers model code
- 11:23LLVM’s intermediate representation
- 22:25Canonicalization and cleanup
- 23:31Software performance abstractions
- 25:58Inlining as critical optimization
- 39:28Optimizing memory and data flow
- 48:29Loop optimizations importance
- 1:09:15Abstractions and pitfalls
- 1:30:28Writing compiler-friendly code
- 1:37:56Conclusion
related talks
01h 05mThe Most Important Optimizations to Apply in Your C++ Programs
57mLLVM Optimization Remarks
08mOn "simple" Optimizations
01h 00mJust-in-Time Compilation
04mZero-Overhead Compiler Pessimization
01h 03mto pass and return, the story of functions, values and compilers
01h 03mUnlocking the value of C++20
01h 09mComputer Architecture, C++, and High Performance
