A dictionary construction technique for code compression systems with echo instructions

Dictionary compression mechanisms identify redundant sequences of instructions that occur in a program. The sequences are extracted and copied to a dictionary. Each sequence is then replaced with a codeword that acts as an index into the dictionary, thereby enabling decompression of the program at runtime. The problem of optimally organizing a dictionary consisting solely of redundant sequences in order to maximize compression has long been known to be NP-Complete [23]. This paper addresses the problem of dictionary construction when redundant code fragments are represented as Data Flow Graphs (DFGs) rather than linear sequences of instructions. Since there are generally multiple legal schedules for a given DFG G, a compiler must determine a schedule for G so that other DFGs that are subgraphs of G can reference some substring of G's final code sequence. This reduces the size of the dictionary, and in turn, the size of the compressed program. Our experiments with 10 MediaBench [18] applications yielded reductions in dictionary size ranging from 21.14% to 29.76% compared to a naïve approach.

[1]  Trevor Mudge,et al.  The Impact of Instruction Compression on I-cache Performance , 1997 .

[2]  Wayne H. Wolf,et al.  Code compression for embedded systems , 1998, Proceedings 1998 Design and Automation Conference. 35th DAC. (Cat. No.98CH36175).

[3]  Majid Sarrafzadeh,et al.  Instruction generation for hybrid reconfigurable systems , 2001, IEEE/ACM International Conference on Computer Aided Design. ICCAD 2001. IEEE/ACM Digest of Technical Papers (Cat. No.01CH37281).

[4]  Robert K. Montoye,et al.  A decompression core for PowerPC , 1998, IBM J. Res. Dev..

[5]  Kurt Keutzer,et al.  A text-compression-based method for code size minimization in embedded systems , 1999, TODE.

[6]  Rajiv Gupta,et al.  Code Compaction of Matching Single-Entry Multiple-Exit Regions , 2003, SAS.

[7]  Christopher W. Fraser An instruction for direct interpretation of LZ77‐compressed programs , 2006, Softw. Pract. Exp..

[8]  A. Wolfe,et al.  Executing Compressed Programs On An Embedded RISC Architecture , 1992, [1992] Proceedings the 25th Annual International Symposium on Microarchitecture MICRO 25.

[9]  Trevor Mudge,et al.  Efficient execution of compressed programs , 2000 .

[10]  Christopher W. Fraser An instruction for direct interpretation of LZ77-compressed programs , 2006 .

[11]  Miodrag Potkonjak,et al.  MediaBench: a tool for evaluating and synthesizing multimedia and communications systems , 1997, Proceedings of 30th Annual International Symposium on Microarchitecture.

[12]  Johan Runeson,et al.  Code Compression through Procedural Abstraction before Register Allocation , 2000 .

[13]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[14]  Majid Sarrafzadeh,et al.  Instruction Selection for Compilers that Target Architectures with Echo Instructions , 2004, SCOPES.

[15]  Koen De Bosschere,et al.  Sifting out the mud: low level C++ code reuse , 2002, OOPSLA '02.

[16]  Brad Calder,et al.  Reducing code size with echo instructions , 2003, CASES '03.

[17]  Amir Roth,et al.  A DISE implementation of dynamic code decompression , 2003 .

[18]  Kevin D. Kissell MIPS16: High-density MIPS for the Embedded Market1 , 1997 .

[19]  Keith D. Cooper,et al.  Enhanced code compression for embedded RISC processors , 1999, PLDI '99.

[20]  Bjorn De Sutter,et al.  Compiler techniques for code compaction , 2000, TOPL.

[21]  James R. Larus,et al.  Using Lightweight Procedures to Improve Instruction Cache Performance , 1999 .

[22]  Christopher W. Fraser,et al.  Analyzing and compressing assembly code , 1984, SIGPLAN '84.