Implementing Counting Analysis in UHC

Publication date

DOI

Document Type

Master Thesis

Collections

Open Access logo

License

CC-BY-NC-ND

Abstract

This thesis describes and implements an extension to counting analysis (defined be Verstoep in [?]). We also describe and implement a strictness optimization based on the results of the extended counting analysis. Counting analysis is a analysis that combines four analyses that count how many times a certain expression is used and demanded. These analyses are absence, sharing, strictness and uniqueness analysis. Having a single analysis that can be used for multiple optimizations is useful in that it is easier to maintain and it prevents cross analysis bugs. It also saves compile time as less analyses are run 1 . The goal of this thesis is to extend counting analysis to the whole of UHC core 2 and give an imple- mentation of counting analysis in the Utrecht Haskell Compiler 3 . Only running the analysis will not result in any faster runtimes, so a strictness optimization is also presented that when run will transform the source code in such a way that the resulting binary runs faster.

Keywords

Haskell, UHC, APA, static analysis

Citation