A Compiler Scheme for Reusing Intermediate Computation Results

  • Authors:
  • Yonghua Ding;Zhiyuan Li

  • Affiliations:
  • -;-

  • Venue:
  • Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Recent research has shown that programs often exhibitvalue locality. Such locality occurs when a code segment,although executed repeatedly in the program, takes only asmall number of different values as input and, naturally,generates a small number of different outputs. It is potentiallybeneficial to replace such a code segment by a tablewhich records the computation results for the previous inputs.When the program execution re-enters the code segmentwith a repeated input, its computation can be simplifiedto a table look-up. In this paper, we discuss a compilerscheme to identify code segments which are good candidatesfor computation reuse. We discuss the conditions underwhich the table look-up costs less than repeating theexecution, and we perform profiling to identify candidateswhich have many repeated inputs at run time. Comparedto previous work, this scheme requires no special hardwaresupport and is therefore particularly useful for resourceconstrained systems such as handheld computing devices.We implement our scheme and its supporting analysesin GCC. We experiment with several multimedia benchmarksand the GNU Go game by executing them on a handheldcomputing device. The results show the scheme to improvethe performance and to reduce the energy consumptionquite substantially for these programs.