Generating Optimizing Specializers

Robert Glück, Jesper Jørgensen. Generating Optimizing Specializers. In Henri E. Bal, editor, Proceedings of the IEEE Computer Society 1994 International Conference on Computer Languages, May 16-19, 1994, Toulouse, France. pages 183-194, IEEE Computer Society, 1994.

Abstract

We propose a new method for improving the spe- cialization of programs by inserting an interpreter between a subject program and a specializer. We formulate three specializer projections which enable us to generate specializers from interpreters. The goal is to provide a new way to control the specialization of programs, and we report the first practical results. This is a step towards the automatic production of specializers. Using an existing, self-applicable partial evaluator we succeeded in generating a stand-alone specializer for a first-order functional language which is stronger than the partial evaluator used for its generation. The generated specializer corresponds to a simple supercompiler. As an example we show that the generated specializer can achieve the same speed-up effect as the Knuth, Morris & Pratt algorithm by specializing a na ̈ıve matcher with respect to a fixed pattern. The generated specializer is also strong enough to handle bounded static variation, a case which partial evaluators usually can not handle.