A statistical analysis of the benefits of partial evaluation on C function calls
Liang, Linda L.
Partial evaluation is a source-to-source program transformation technique which substitutes the constant or known part of the input at compilation time to get an updated program. To help make decisions as to what kind of partial evaluation to implement, statistics have been collected on the use of translation-time constant arguments in C language source code. Source code from three important projects coded in C was analyzed: the X-Windows library, the LINUX operating system, and the Gnu C compiler "gcc." These projects also present typical modern uses of the C language. The frequency of constant arguments in argument lists can have important implication of the worth of certain code improvement strategies. Specifically, compiler writers and partial-evaluator designers can benefit from these statistics if they are planning to do any of the following: replacing calls of functions with all constant arguments by function results, unfolding function calls, or specializing functions for specific values of actual arguments. The statistics collected show that these partial evaluation techniques can yield significant performance improvement for some projects, at reasonable costs in memory usage.