Exploiting Function Similarity for Code Size Reduction

Tobias J.K. Edler von Koch, Björn Franke, Pranav Bhandarkar, Anshuman Dasgupta

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

For cost-sensitive or memory constrained embedded systems, code size is at least as important as performance. Consequently, compact code generation has become a major focus of attention within the compiler community. In this paper we develop a pragmatic, yet effective code size reduction technique, which exploits structural similarity of functions. It avoids code duplication through merging of similar functions and targeted insertion of control flow to resolve small differences. We have implemented our purely software based and platform-independent technique in the LLVM compiler frame work and evaluated it against the SPEC CPU2006 benchmarks and three target platforms: Intel x86, ARM based Qualcomm Krait™, and Qualcomm Hexagon™ DSP. We demonstrate that code size for SPEC CPU2006 can be reduced by more than 550KB on x86. This corresponds to an overall code size reduction of 4%, and up to 11.5% for individual programs. Overhead introduced by additional control flow is compensated for by better I-cache performance of the compacted programs. We also show that identifying suitable candidates and subsequent merging of functions can be implemented efficiently.
Original languageEnglish
Title of host publicationProceedings of the 2014 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems
Place of PublicationNew York, NY, USA
PublisherACM
Pages85-94
Number of pages10
ISBN (Print)978-1-4503-2877-7
DOIs
Publication statusPublished - 12 Jun 2014
Event2014 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems - Edinburgh, United Kingdom
Duration: 12 Jun 201413 Jun 2014
http://www.ittc.ku.edu/lctes14/

Publication series

NameACM SIGPLAN Notices
PublisherACM
Number5
Volume49
ISSN (Print)0362-1340
ISSN (Electronic)1558-1160

Conference

Conference2014 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems
Abbreviated titleLCTES 2014
Country/TerritoryUnited Kingdom
CityEdinburgh
Period12/06/1413/06/14
Internet address

Keywords

  • code size, function merging, function similarity

Fingerprint

Dive into the research topics of 'Exploiting Function Similarity for Code Size Reduction'. Together they form a unique fingerprint.

Cite this