Flow-Analysis-Based Closure Optimization
summary
Implementation in Standard ML of New Jersey with an LLVM backend uses a sparse zero-CFA to guide concrete closure-representation decisions: selective heap tuple sharing and controlled spreading into registers while preserving safe-for-space guarantees. The compiler rewrites layouts per closure class (bipartite def–use components) and evaluates on x86-64 and ARM64; results show a 10% geometric mean speedup, a best-case 1.7× runtime improvement and allocation reductions down to 16% of the baseline.
AI-written summary · about
chapters (18)
- 0:00Closure optimization intro
- 1:46Flat closure trade-offs
- 3:12Why nested closures
- 4:18Sharing closures to reduce alloc
- 5:40Space leaks in sharing
- 6:46Closure compaction for hot paths
- 7:30Spreading closures across regs
- 9:55Flow analysis for smart decisions
- 11:19Higher-order flow analysis in SML/NJ
- 12:42Control-flow for optimization
- 13:03Closure class analysis
- 14:06Layout and rewriting
- 15:09Baseline vs SML/NJ
- 15:53ARM64 performance
- 16:57Related work on closures
- 17:42Q&A calling conventions
- 18:44Q&A space leaks
- 19:48Q&A profile-guided opt
related talks
22mEfficient OCaml compilation with Flambda 2
01h 05mControl Flow Obfuscation for Featherweight Java + Efficient Fair Conjunction
11mType-Preserving Flat Closure Optimization
31mRange-Analysis-Based Optimization for SML/NJ
27mCompiler Support for Control-Flow Linearization Using Architectural Mimicry
19mSo You Want To Analyze Scheme Programs With Datalog?
01h 38mGHC Core Optimisations
20mVectorizing Sparse Coiteration for Two-finger Loop Structure (Extended Abstract)
