Hot Call-Chain Inlining for the Glasgow Haskell Compiler
summary
Proposes a profile-directed hot call-chain inlining pass for GHC that extracts call chains from the AST, marks functions with INLINE/INLINABLE pragmas during desugaring, and feeds GHC’s existing pragma machinery; experiments use GHC profiling and modify 17 real-world Stackage packages. Machine learning approaches fail; the pragma-based tool yields a geometric-mean runtime speedup of 9% over default GHC (10% when combined with existing developer pragmas), about 1% mean code-size growth (two packages 6–7%).
AI-written summary · about
chapters (15)
- 0:00Hot call-chain inlining intro
- 1:52Why inlining matters in Haskell
- 3:57GHC inliner limitations
- 5:01Genetic algorithms for inlining
- 7:50Neural networks for inlining
- 8:34Source-level inlining pragmas
- 10:03Performance gains from pragmas
- 12:11Hot call chains and control flow
- 14:17Profiling hotspots with GHC
- 15:43Experimental setup
- 16:47Naive inlining pragmas
- 17:31Results from hot pragmas
- 19:59Code size and safety
- 20:21Conclusion and future
- 20:45Q&A
related talks
35mInlining: bright victories and hidden defeats
29mAnnotating Deeply Embedded Languages
06mProfile-Guided Optimization in the Go Compiler
24mFunction Inlining
17mInlined Code Generation for Smalltalk
34mWhat happens to your code when you don't look?
01h 30mGHC Proposal Presentations
01h 38mGHC Core Optimisations
