Code compaction of matching single-entry multiple-exit regions

  • Authors:
  • Wen-Ke Chen;Bengu Li;Rajiv Gupta

  • Affiliations:
  • Dept. of Computer Science, The University of Arizona, Tucson, Arizona;Dept. of Computer Science, The University of Arizona, Tucson, Arizona;Dept. of Computer Science, The University of Arizona, Tucson, Arizona

  • Venue:
  • SAS'03 Proceedings of the 10th international conference on Static analysis
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

With the proliferation of embedded devices and systems, there is renewed interest in the generation of compact binaries. Code compaction techniques identify code sequences that repeatedly appear in a program and replace them by a single copy of the recurring sequence. In existing techniques such sequences are typically restricted to single-entry single-exit regions in the control flow graph. We have observed that in many applications recurring code sequences form single-entry multipleexit (SEME) regions. In this paper we propose a generalized algorithm for code compaction that first decomposes a control flow graph into a hierarchy of SEME regions, computes signatures of SEME regions, and then uses the signatures to find pairs of matching SEME regions. Maximal sized matching SEME regions are found and transformed to achieve code compaction. Our transformation is able to compact matching SEME regions whose exits may lead to a combination of identical and differing targets. Our experiments show that this transformation can lead to substantial reduction in code size for many embedded applications.