Compiler techniques for code compaction

Saumya K. Debray, William Evans, Robert Muth, Bjorn De Sutter

Research output: Contribution to journalArticlepeer-review

176 Scopus citations


In recent years there has been an increasing trend toward the incorporation of computers into a variety of devices where the amount of memory available is limited. This makes it desirable to try to reduce the size of applications where possible. This article explores the use of compiler techniques to accomplish code compaction to yield smaller executables. The main contribution of this article is to show that careful, aggressive, interprocedural optimization, together with procedural abstraction of repeated code fragments, can yield significantly better reductions in code size than previous approaches, which have generally focused on abstraction of repeated instruction sequences. We also show how "equivalent" code fragments can be detected and factored out using conventional compiler techniques, and without having to resort to purely linear treatments of code sequences as in suffix-tree-based approaches, thereby setting up a framework for code compaction that can be more flexible in its treatment of what code fragments are considered equivalent. Our ideas have been implemented in the form of a binary-rewriting tool that reduces the size of executables by about 30% on the average.

Original languageEnglish (US)
Pages (from-to)378-415
Number of pages38
JournalACM Transactions on Programming Languages and Systems
Issue number2
StatePublished - Mar 2000


  • Code compaction
  • Code compression
  • Code size
  • Compilers
  • D.3.4 [Programming Languages]: Processors - code generation
  • E.4 [Coding and Information Theory]: Data Compaction and Compression - Program, representation
  • Experimentation
  • Optimization
  • Performance

ASJC Scopus subject areas

  • Software


Dive into the research topics of 'Compiler techniques for code compaction'. Together they form a unique fingerprint.

Cite this