Compiler techniques for code compaction

被引:136
作者
Debray, SK [1 ]
Evans, W
Muth, R
De Sutter, B
机构
[1] Univ Arizona, Dept Comp Sci, Tucson, AZ 85721 USA
[2] Compaq Comp Corp, Alpha Dev Grp, Hudson, MA 01749 USA
[3] State Univ Ghent, Dept Elect & Informat Syst, B-9000 Ghent, Belgium
来源
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS | 2000年 / 22卷 / 02期
关键词
experimentation; performance; code compaction; code compression; code size reduction;
D O I
10.1145/349214.349233
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:378 / 415
页数:38
相关论文
共 20 条
[1]  
AHO AV, 1985, COMPILERS PRINCIPLES
[2]  
[Anonymous], 1979, Computers and Intractablity: A Guide to the Theoryof NP-Completeness
[3]  
Baker B. S., 1993, Proceedings of the Twenty-Fifth Annual ACM Symposium on the Theory of Computing, P71, DOI 10.1145/167088.167115
[4]  
Baker BS, 1998, PROCEEDINGS OF THE USENIX 1998 ANNUAL TECHNICAL CONFERENCE, P179
[5]  
BENES M, 1998, P INT S ADV RES AS C
[6]  
COOPER KD, 1999, ACM C PROGR LANG DES, P139
[7]  
DEBRAY S, 2000, 0004 U AR DEP COMP S
[8]  
ERNST J, 1997, ACM C PROGR LANG DES
[9]   Slim barriers [J].
Franz, M ;
Kistler, T .
COMMUNICATIONS OF THE ACM, 1997, 40 (12) :87-94
[10]  
Franz M, 1997, LECT NOTES COMPUT SC, V1222, P263