The costs and benefits of cloning in a lazy functional language

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 n umber 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 th e memory hierarchy of the target machine, this may increase the instruction cac he 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 c loning in the context of an optimizing compiler for a simple lazy function al language. We will also evaluate a few techniques for reducing the number o f instruction cache misses.