Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Post-compilation optimization for multiple gains with pattern matching

Published: 01 December 2005 Publication History

Abstract

Many existing retargetable compilers for ASIPs and domain-specific processors generate low quality code since the compiler is not able to fully utilize the intricacies of ISA of these processors. Hence, there is a need to further optimize the code produced by these compilers. In this paper, we introduce a new post-compilation optimization technique which is based on finding repeating instruction patterns in generated code and replacing them with their optimized equivalents. The instruction patterns to be found are represented by finite state machines which allow encapsulation of multiple patterns in just one representation, and instructions in a pattern to be not necessarily lexically adjacent. We also present a conflict resolution algorithm to select an optimization whenever a set of instructions fall under two or more different patterns of which only one can be applied on the basis of code size, cycle count or switching activity improvement. We tested this technique on the compiled binaries of ARM and Intel processors for code size improvement. We discuss the possible applications of this strategy in design space exploration (DSE) of embedded processors.

References

[1]
B. D. Bus, D. Kastner, D. Chanet, L. V. Put, and B. D. Sutter. Post-pass compaction techniques. Communications of the ACM, 46(8): 41--46, August 2003.
[2]
B. D. Bus, B. D. Sutter, L. V. Put, D. Chanet, and K. D. Bosschere. Link-time optimization of ARM binaries. ACM SIGPLAN Notices, 39(6):211--220, June 2004.
[3]
J. W. Davidson. Automatic generation of peephole optimizations. ACM SIGPLAN Notices, 39(4): 104--111, April 2004.
[4]
J. W. Davidson and C. W. Fraser. The design and application of a retargetable peephole optimizer. ACM Trans. Programming Languages & Systems, 2(2): 191--202, April 1980.
[5]
J. W. Davidson and C. W. Fraser. Code selection through object code optimization. ACM Trans. Programming Languages & Systems, 6(4):505--526, October 1984.
[6]
S. Debray and W. Evans. Profile-guided code compression. ACM SIGPLAN Notices, 37(5): 95--105, May 2002.
[7]
S. K. Debray and W. Evans, R. Muth, and B. D. Sutter. Compiler techniques for code compaction. ACM Trans. Programming Languages & Systems, 22(2): 378--415, March 2000.
[8]
J. Ernst, W. Evans, C. Fraser, S. Lucco, and T. Proebsting. Code compression. In Proc. PLDI, pages 358--365, June 1997.
[9]
M. Franz. Adaptive compression of syntax trees and iterative dynamic code optimization: Two basic technologies for mobile object systems. In J. Vitek and C. Tschudin (Ed.), Mobile Object Systems: Towards the Programmable Internet, LNCS 1222: 263--276. Springer-Verlag. Feb. 1997.
[10]
M. Franz and T. Kistler. Slim binaries. Communications of ACM, 40(12): 87--94, Dec. 1997.
[11]
C. W. Fraser. Automatic inference of models for statistical code compression. In Proc. PLDI, pages 242--246, May 1999.
[12]
C. W. Fraser, E. W. Myers, and A. L. Wendt. Analyzing and compressing assembly code. In Proc. ACM Symp. Compiler Construction, 19: 117--121, June 1984.
[13]
M. Ghosh. Compiler Backend Generation and a Post-Compilation Optimization Technique for Extensible Architecture. MS Thesis. Computer Sc. & Engineering Department, IIT Kharagpur, 2004.
[14]
T. M. Kemp, R. M. Montoye, J. D. Harper, J. D. Palmer, and D. J. Auerbach. A decompression core for PowerPC. IBM J. Research and Development, 42(6), Nov. 1998.
[15]
P. B. Kessler. Discovering machine-specific code improvements. In Proc. Symp. Compiler Construction. ACM SIGPLAN Notices, 21(7): 249--254, July 1986.
[16]
R. R. Kessler. Peep: An architectural description driven peephole optimizer. ACM SIGPLAN Notices, 19(6): 106--110, June 1984.
[17]
K. D. Kissell. MIPS16: High-density MIPS for the embedded market. In Proc. Real Time Systems (RTS97), 1997.
[18]
D. A. Lamb. Construction of a peephole optimizer. Software - Practice and Experience, 11(6): 638--647, June 1981.
[19]
S. Lee, A. Ermedahl, S. L. Min, and N. Chang. An accurate instruction-level energy consumption model for embedded RISC processors. ACM SIGPLAN Notices, 36(8): 1--10, August 2001.
[20]
H. Lekatsas, J. Henkel, V. Jakkula, and S. Chakradhar. A unified architecture for adaptive compression of data and code on embedded systems. In Proc. VLSI Design Conf.: 117--123, January 2005. IEEE CS Press.
[21]
R. Leupers. Compiler design issues for embedded processors. IEEE Design & Test of Computers, 19(4): 51--58, July-Aug. 2002.
[22]
McKeeman. Peephole optimization. Communications of the ACM, 8(7): 443--444, July 1965.
[23]
B. J. McKenzie. Fast peephole optimization techniques. Software - Practice & Experience, 19(12): 1151--1162, December, 1989.
[24]
S. Nystrom, J. Runeson, and J. Sjodin. Code compression techniques for embedded systems, 2000.
[25]
B. S. Pankaj and A. Gupta. Porting NET and a Post Compilation Optimization Technique. B. Tech. Project Report. Computer Sc. & Engineering Dept., IIT Kharagpur, May 2004.
[26]
W. Pugh. Compressing Java class files. In Proc. PLDI, pages 247--258, May 1999.
[27]
D. Spinellis. Declarative peephole optimization using string pattern matching. ACM SIGPLAN Notices, 34(2):47--50, February 1999.
[28]
B. D. Sutter, B. D. Bus. K. D. Bosschere, and S. Debray. Combining global code and data compaction. ACM SIGPLAN Notices, 36(8):29--38, August 2001.
[29]
A. S. Tanenbaum. H. V. Staveren, and J. W. Stevenson. Using peephole optimization on intermediate code. ACM Trans. Programming Languages & Systems, 4(1): 21--36, January 1982.
[30]
M. Zastre. Compacting object code via parameterized procedural abstraction. Master's thesis, University Victoria, 1995.
[31]
M. Zhao, B. Childers, and M. L. Soffa. Predicting the impact of optimizations for embedded systems. In Proc. LCTES-03, San Diego, CA. ACM SIGPLAN Notices, 38(6): 1--11, June 2003.

Cited By

View all

Index Terms

  1. Post-compilation optimization for multiple gains with pattern matching

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 40, Issue 12
    December 2005
    32 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1117303
    Issue’s Table of Contents

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 December 2005
    Published in SIGPLAN Volume 40, Issue 12

    Check for updates

    Author Tags

    1. instruction set FSM
    2. pattern matching
    3. peephole optimization
    4. post-compilation optimization

    Qualifiers

    • Article

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)3
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 15 Oct 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2017)Modified fly ash and zeolites as an effective adsorbent for metal ions from aqueous solutionAdsorption Science & Technology10.1177/026361741770042035:5-6(519-533)Online publication date: 11-Apr-2017
    • (2016)Design and evaluation of compact ISA extensionsMicroprocessors & Microsystems10.1016/j.micpro.2015.09.01040:C(1-15)Online publication date: 1-Feb-2016
    • (2013)x86 instruction reordering for code compressionActa Cybernetica10.14232/actacyb.21.1.2013.1321:1(177-190)Online publication date: 1-Jan-2013
    • (2012)An embedded cross-assembler optimization method2012 International Conference on Computer Science and Information Processing (CSIP)10.1109/CSIP.2012.6308935(641-644)Online publication date: Aug-2012
    • (2011)MAO -- An extensible micro-architectural optimizerProceedings of the 9th Annual IEEE/ACM International Symposium on Code Generation and Optimization10.5555/2190025.2190077(1-10)Online publication date: 2-Apr-2011
    • (2011)MAO — An extensible micro-architectural optimizerInternational Symposium on Code Generation and Optimization (CGO 2011)10.1109/CGO.2011.5764669(1-10)Online publication date: Apr-2011
    • (2010)A VLIW-based post compilation framework for multimedia embedded DSPs with hardware specific optimizationsProceedings of the Second Russia-Taiwan conference on Methods and tools of parallel programming multicomputers10.5555/1927517.1927525(51-58)Online publication date: 16-May-2010
    • (2010)A VLIW-Based Post Compilation Framework for Multimedia Embedded DSPs with Hardware Specific OptimizationsMethods and Tools of Parallel Programming Multicomputers10.1007/978-3-642-14822-4_6(51-58)Online publication date: 2010

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media