Dealing with aliasing using contracts
summary
Shows that annotating non-aliasing actually matters: real benchmarks report a mean speed >2x and rare cases up to 40x or 50x. Explains why type-based alias analysis and current compilers fall short, why C’s restrict is ambiguous, and why runtime checks or static contracts are needed. Proposes concrete solutions — a disjoint annotation, alias sets, and a “unique span” type — and describes which are implementable, what compilers currently do, and what remains unbuilt.
AI-written summary · about
chapters (11)
- 0:00Aliasing in C++
- 3:59Aliasing and performance
- 8:07Fortran’s aliasing edge
- 10:42Vectorization and aliasing
- 16:07Type-based alias analysis limits
- 22:29C’s restrict qualifier limits
- 24:21Contracts for aliasing
- 37:19Contracts for user types
- 44:43Undefined behavior in stdlib
- 47:18C++ aliasing proposals
- 51:29Q&A
related talks
18mAliasing Limits on Translating C to Safe Rust
58mArgument Passing, Core Guidelines and Aliasing
36mThe language that isn't
07mThe Perils of Strict Aliasing
01h 01mEmbracing (and also Destroying) Variant Types Safely
01h 50mUnderstanding Compiler Optimization
37mDuck-Tape Chronicles: Rust/C++ Interop
01h 00mJust-in-Time Compilation
