The costs and benefits of cloning in a lazy functional language
Karl‐Filip Faxén · 2000
Cloning is a transformation where several copies are made of some functions in a program in order to improve the effectiveness of optimizations of these functions. Cloning may thus lead to a reduction in the number of executed instructions, but it does in general also lead to an increase in the size of the executable program. Depending on the characteristics of the memory hierarchy of the target machine, this may increase the instruction cache miss rate enough that the cloned program executes slower than the original. In this paper we try to quantify both the benefits and costs of cloning in the context of an optimizing compiler for a simple lazy functional language. We will also evaluate a few techniques for reducing the number of instruction cache misses. 1 Introduction Cloning is a program transformation where functions called from multiple call sites are duplicated. In general, this increases the effectiveness of optimizations which depend on properties which may hold at some, b...