ICFP 2022
Sun 11 - Fri 16 September 2022 Ljubljana, Slovenia
Fri 16 Sep 2022 11:00 - 11:30 at Kosovel - Compiler and Extensions Chair(s): Marco Vassena

Inlining is a widely studied compiler optimization that is particularly important for functional languages such as Haskell and OCAML. The Glasgow Haskell Compiler (GHC) inliner is a heuristic of such complexity, however, that it has not significantly changed for nearly 20 years. It heavily relies on hard-coded numeric constants, or magic numbers, based on out-of-date intuition. Dissatisfaction with inlining performance has led to the wide-spread use of inlining pragmas by programmers. In this paper, we present an in-depth study of the effect of inlining on performance in functional languages. We specifically focus on the inlining behavior of GHC and present techniques to systematically explore the space of possible magic-number values, or configurations, and evaluate their performance on a set of real-world benchmarks where inline pragmas are present. Pragmas may slow down individual programs, but on average improve performance by 10%. Searching for the best configuration on a per-program basis increases this performance to an average of 27%. Searching for the best configuration for each program is, however, expensive and unrealistic, requiring repeated compilation and execution. This paper determines a new single configuration that gives a 22% improvement on average across the benchmarks. Finally, we use a simple machine learning model that predicts the best configuration on a per-program basis, giving a 26% average improvement.

Fri 16 Sep

Displayed time zone: Belgrade, Bratislava, Budapest, Ljubljana, Prague change

11:00 - 12:30
Compiler and ExtensionsHaskell at Kosovel
Chair(s): Marco Vassena Utrecht University
11:00
30m
Talk
Investigating Magic Numbers: Improving the Inlining Heuristic in the Glasgow Haskell Compiler
Haskell
Celeste Hollenbeck University of Edinburgh, Michael F. P. O'Boyle University of Edinburgh, Michel Steuwer University of Edinburgh
11:30
30m
Talk
Partial Type Constructors in Practice
Haskell
Apoorv Ingle University of Iowa, Alex Hubers The University of Iowa, J. Garrett Morris The University of Iowa
12:00
30m
Talk
Reasonable Agda is Correct Haskell: Writing Verified Haskell using agda2hs
Haskell
Jesper Cockx TU Delft, Lucas Escot TU Delft, Orestis Melkonian University of Edinburgh, James Chapman Input Output, Ulf Norell Gothenburg University
Pre-print File Attached