Technical Report: DCC-2001-7

Controlling Code Expansion in a Multiple Specialization Implementation

 Michel Ferreira and Luís Damas

DCC-FC & LIACC, Universidade do Porto
R. do Campo Alegre 823, 4150-180 Porto, Portugal
Phone: 351 22 6078830, Fax: 351 22 6003654
E-mail: {michel,luis}@ncc.up.pt
  September 2001

Abstract

Program specialization can be single or multiple, depending if each procedure of the program is specialized into one or more versions. Multiple specialization has severe consequences on code growth. In order to keep a multiple specialization strategy implementable on real-size programs, large and efficient selection of the predicates to be multiply specialized must be done. We present a multiple specialization Prolog compiler that bases the control of code growth on a predicate selection driven by a WAM-level profiler. Such code expansion control is also achieved by finding the optimal set of versions for a particular predicate. In this case a non-strictly-identical collapsing of versions is performed, also at the WAM-level. The results show a time per predicate distribution in Prolog programs where partial multiple specialization can importantly speed-up execution, while keeping code size reasonable.