## Improving supercompilation: tagbags, rollback, speculation, normalisation, and generalisation (2011)

### Cached

### Download Links

Citations: | 4 - 0 self |

### BibTeX

@MISC{Bolingbroke11improvingsupercompilation:,

author = {Maximilian Bolingbroke and Simon Peyton Jones},

title = {Improving supercompilation: tagbags, rollback, speculation, normalisation, and generalisation},

year = {2011}

}

### OpenURL

### Abstract

Supercompilation is a powerful technique for program optimisation and theorem proving. In this paper we describe and evaluate three improvements to the Cambridge Haskell Supercompiler (CHSC). We reduce supercompiled program size by the use of a weak normaliser and aggressive rollback, and we improve the performance of supercompiled programs by heap speculation and generalisation. Our generalisation method is simpler than those in the literature, and is better at generalising computations involving primitive operations such as those on machine integers. We also provide the first comprehensive account of the tag-bag termination mechanism.

### Citations

411 | Deforestation: Transforming Programs to Eliminate Trees
- Wadler
- 1990
(Show Context)
Citation Context ... to both automatically prove theorems about programs [2] and greatly improve the efficiency with which they execute [3]. Supercompilation is capable of achieving transformations such as deforestation =-=[4]-=-, function specialisation and constructor specialisation [5]. Despite its remarkable power, the transformation is simple, principled and fully automatic. Supercompilation is closely related to partial... |

171 | The concept of a supercompiler
- Turchin
- 1986
(Show Context)
Citation Context ...l) languages; D.3.4 [Programming Languages]: Processors – Optimization General Terms 1. Overview Algorithms, Performance Supercompilation is a powerful program transformation technique due to Turchin =-=[1]-=- which can be used to both automatically prove theorems about programs [2] and greatly improve the efficiency with which they execute [3]. Supercompilation is capable of achieving transformations such... |

75 | The nofib benchmark suite of Haskell programs
- Partain
- 1992
(Show Context)
Citation Context ...lback by observing the impact of enabling them when supercompiling the benchmark suite we will use for all performance tests in this paper: • Seven examples from the nofib “imaginary” benchmark suite =-=[13]-=- (bernouilli, digitsofe2, exp3 8, primes, rfib, tak and x2n1) • Five standard example programs used in previous work on supercompilation and deforestation [3, 4, 9, 14] (append, factorial, raytracer, ... |

75 | An algorithm of generalization in positive supercompilation
- Sørensen, Glück
- 1995
(Show Context)
Citation Context ... changing, the accumulator n. 4.2 Our solution The problem of how to continue when the supercompiler termination criteria fails is well known and is solved by the choice of some generalisation method =-=[10, 16]-=-. The goal of generalisation is to use the specialisations generated thus far to infer a “more general” specialisation that subsumes both of them. Almost all supercompilers implement generalisation by... |

68 | Deriving a lazy abstract machine - Sestoft - 1997 |

62 | On the power of homeomorphic embedding for online termination
- Leuschel
- 1998
(Show Context)
Citation Context ...lso used sc, to ensure that sc only recurses a finite number of times, thus ensuring the supercompiler is total 2 . One way to implement such a termination criterion is by defining a well-quasi-order =-=[12]-=-. The relation � ∈ S × S is a wellquasi-order (WQO) iff for all infinite sequences of elements of S (s0, s1, . . .), it holds that: ∃ij. i < j ∧ si � sj. Given any WQO �: State × State, we can impleme... |

44 | The algorithm of generalization in the supercompiler - Turchin - 1988 |

44 | Stream fusion: From lists to streams to nothing at all
- Coutts, Leshchinskiy, et al.
- 2007
(Show Context)
Citation Context ...ard example programs used in previous work on supercompilation and deforestation [3, 4, 9, 14] (append, factorial, raytracer, sumtree, treeflip) • One benchmark (sumsquare) from work on stream fusion =-=[15]-=-. Our supercompiler (CHSC) is implemented as a preprocessor. All benchmarks are performed compiling the supercompiled program with GHC at the highest −O2 optimisation level. To evaluate the rollback f... |

24 | Towards unifying partial evaluation, deforestation, supercompilation, and GPC
- Sørensen, Glück, et al.
(Show Context)
Citation Context ...its remarkable power, the transformation is simple, principled and fully automatic. Supercompilation is closely related to partial evaluation, but can achieve strictly more optimising transformations =-=[6]-=-. The key contributions of this paper are as follows: • We briefly describe the structure of our call-by-need supercompiler 1 . This improves on prior work [7] in two ways. Firstly, we allow the super... |

21 | A supercompiler for core Haskell
- Mitchell, Runciman
- 2008
(Show Context)
Citation Context ...troduced by Mitchell [9]. The other major approach is to use a homeomorphic embedding on syntax trees [12] but supercompilers that use that method tend to spend most of their time evaluating the test =-=[17]-=-. Supero 2010 [9] used a generalisation mechanism for call-byneed supercompilers that use the tag-bag termination mechanism. The idea is that when computing a child term for recursive supercompilation... |

17 | Call-pattern specialisation for Haskell programs
- Jones
- 2007
(Show Context)
Citation Context ... greatly improve the efficiency with which they execute [3]. Supercompilation is capable of achieving transformations such as deforestation [4], function specialisation and constructor specialisation =-=[5]-=-. Despite its remarkable power, the transformation is simple, principled and fully automatic. Supercompilation is closely related to partial evaluation, but can achieve strictly more optimising transf... |

16 | S.: Optimistic evaluation: an adaptive evaluation strategy for non-strict programs
- Ennals, Jones
- 2003
(Show Context)
Citation Context ...ct-style supercompiler, as well as how to apply the concept to “loopy” reduction and heap speculation. Our decision to use speculative evaluation in the supercompiler was initially inspired by Ennals =-=[19]-=-, though runtime speculation faces very different tradeoffs and design issues. 9. Conclusions and further work We have described a highly-modular supercompiler whose performance is comparable to or be... |

15 | Positive supercompilation for a higher order call-by-value language
- Jonsson, Nordlander
- 2009
(Show Context)
Citation Context ... is a powerful program transformation technique due to Turchin [1] which can be used to both automatically prove theorems about programs [2] and greatly improve the efficiency with which they execute =-=[3]-=-. Supercompilation is capable of achieving transformations such as deforestation [4], function specialisation and constructor specialisation [5]. Despite its remarkable power, the transformation is si... |

13 | Supercompiler HOSC 1.0: under the hood
- Klyuchnikov
- 2009
(Show Context)
Citation Context ...hod simply requires a set membership test per inlining. The effect of rollback on the sc is present in standard supercompilers constructed around the idea of a “graph of configurations”, such as HOSC =-=[18]-=-. In such systems, when an earlier graph node a is embedded into a later node b, the a node (rather than the b node) is generalised. This has the effect of cutting off the part of the graph reachable ... |

12 | Supercompilation by Evaluation
- Bolingbroke, Jones
- 2010
(Show Context)
Citation Context ...strictly more optimising transformations [6]. The key contributions of this paper are as follows: • We briefly describe the structure of our call-by-need supercompiler 1 . This improves on prior work =-=[7]-=- in two ways. Firstly, we allow the supercompiler to tie back more often (reducing supercompiler run time and output size) by making use of a weak term normalisation procedure (Section 2.4). Secondly,... |

11 | Rethinking Supercompilation
- Mitchell
- 2010
(Show Context)
Citation Context ... used for two quite separate purposes in CHSC2. First, they are used to drive the termination test (Section 2.3), and second they are used to guide generalisation (Section 4). Neither is entirely new =-=[7, 9]-=-, but the contribution of this paper is for the first time to make precise these earlier informal accounts, and to introduce some useful refinements. The operational semantics of Figure 3 makes explic... |

7 | Supercompiler HOSC 1.1: Proof of Termination
- Klyuchnikov
- 2010
(Show Context)
Citation Context ...s rather than Terms is a consequence of our use of a State-based operational semantics, but it pays off elsewhere in the supercompiler 2 We do not prove this fact here, but it is a standard technique =-=[10, 11]-=-. 3 It is simple matter to memoise the repeated use of tagBag on prevs. — particularly in the splitter (Section 2.7), which operates distinctively on each of the three component of the State. Compared... |

5 |
Deforestation of a raytracer
- Kort
- 1996
(Show Context)
Citation Context ...om the nofib “imaginary” benchmark suite [13] (bernouilli, digitsofe2, exp3 8, primes, rfib, tak and x2n1) • Five standard example programs used in previous work on supercompilation and deforestation =-=[3, 4, 9, 14]-=- (append, factorial, raytracer, sumtree, treeflip) • One benchmark (sumsquare) from work on stream fusion [15]. Our supercompiler (CHSC) is implemented as a preprocessor. All benchmarks are performed ... |

2 | Verification as specialization of interpreters with respect to data
- Lisitsa, Nemytykh
- 2008
(Show Context)
Citation Context ...eral Terms 1. Overview Algorithms, Performance Supercompilation is a powerful program transformation technique due to Turchin [1] which can be used to both automatically prove theorems about programs =-=[2]-=- and greatly improve the efficiency with which they execute [3]. Supercompilation is capable of achieving transformations such as deforestation [4], function specialisation and constructor specialisat... |