Beating Hand Tuned Assembly in Compiled Languages
summary
Claims a practical 20x win over hand-tuned assembly for real-world inputs by generating 85,000 lines of generated C++ from four lines of algorithmic code, using register-tiling that reduces memory accesses and hardware counter-guided tuning. Method increases arithmetic but cuts cache/TLB loads, yields up to ~7x speedups over GMP on key kernels, multiplies with algorithmic gains so overall runtimes shrink (parity with assembly only around degree ~10,000). Work takes ~18 months and produces reproducible auto-generated code and three world records.
AI-written summary · about
chapters (13)
- 0:00Introduction and motivation
- 4:38What is multi-precision arithmetic
- 14:18GMP library and its optimizations
- 20:38Problem with single-operation focus
- 23:53Root isolation algorithm overview
- 30:37Memory access and tiling strategy
- 37:17Cache tiling results and limitations
- 39:47Register tiling implementation
- 45:46Performance speedup with register tiles
- 51:04Comparing with hand-tuned assembly
- 53:13Full recursion tree evaluation
- 57:05Benchmarking and final results
- 59:09Q&A and closing
related talks
46mWhat C and C++ can do and when do you need Assembly?
15mCopy-and-Patch Compilation
54mProgramming Language Design and Implementation for the Machine Learning Era: A Personal(…)
14mOn-Stack Replacement for Program Generators and Source-to-Source Compilers
19mCausalTuner: Feature-Aware Causal Guidance for Compiler Auto-tuning
20mGrouptuner: Efficient Group-Aware Compiler Auto-tuning
33mImproving the Effectiveness and Generality of GCC Auto-Vectorization
15mNot So Fast: Understanding and Mitigating Negative Impacts of Compiler Optimizations on Code Reuse G
