skip to main content
10.1145/1133981.1133988acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

Fast and flexible instruction selection with on-demand tree-parsing automata

Published:11 June 2006Publication History

ABSTRACT

Tree parsing as supported by code generator generators like BEG, burg, iburg, lburg and ml-burg is a popular instruction selection method. There are two existing approaches for implementing tree parsing: dynamic programming, and tree-parsing automata; each approach has its advantages and disadvantages. We propose a new implementation approach that combines the advantages of both existing approaches: we start out with dynamic programming at compile time, but at every step we generate a state for a tree-parsing automaton, which is used the next time a tree matching the state is found, turning the instruction selector into a fast tree-parsing automaton. We have implemented this approach in the Gforth code generator. The implementation required little effort and reduced the startup time of Gforth by up to a factor of 2.5.

References

  1. A. Balachandran, D. M. Dhamdhere, and S. Biswas. Efficient retargetable code generation using bottom-up tree pattern matching. Computer Languages, 15(3):127--140, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. David R. Chase. An improvement to bottom-up tree pattern matching. In Fourteenth Annual ACM Symposium on Principles of Programming Languages, pages 168--177, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Anton Ertl and David Gregg. Combining stack caching with dynamic superinstructions. In Interpreters, Virtual Machines and Emulators (IVME '04), pages 7--14, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Helmut Emmelmann, Friedrich-Wilhelm Schröer, and Rudolf Landwehr. BEG - a generator for efficient back ends. In SIGPLAN '89 Conference on Programming Language Design and Implementation, pages 227--237, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Christopher W. Fraser and David R. Hanson. A retargetable compiler for ANSI C. SIGPLAN Notices, 26(10):29--43, October 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Christopher W. Fraser and Robert R. Henry. Hard-coding bottom-up code generation tables to save time and space. Software-Practice and Experience, 21(1):1--12, January 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christopher Fraser and David Hanson. A Retargetable C compiler: Design and Implementation. Benjamin/Cummings Publishing, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Christopher W. Fraser, Robert R. Henry, and Todd A. Proeb-sting. BURG - fast optimal instruction selection and tree parsing. SIGPLAN Notices, 27(4):68--76, April 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Christopher W. Fraser, David R. Hanson, and Todd A. Proebsting. Engineering a simple, efficient code generator generator. ACM Letters on Programming Languages and Systems, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jan Heering, Paul Klint, and Jan Reekers. Incremental generation of parsers. IEEE Transactions on Software Engineering, 16(12):1344--1351, December 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Eduardo Pelegrí-Llopart and Susan L. Graham. Optimal code generation for expression trees: An application of the BURS theory. In Fifteenth Annual ACM Symposium on Principles of Programming Languages, pages 294--308, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Todd A. Proebsting. BURS automata generation. ACM Transactions on Programming Languages and Systems, 17(3):461--486, May 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Eric Schnarr and James R. Larus. Fast out-of-order processor simulation using memoization. In Architectural Support for Programming Languages and Operating Systems (ASPLOS-VIII), pages 283--294, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Fast and flexible instruction selection with on-demand tree-parsing automata

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      PLDI '06: Proceedings of the 27th ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2006
      438 pages
      ISBN:1595933204
      DOI:10.1145/1133981
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 41, Issue 6
        Proceedings of the 2006 PLDI Conference
        June 2006
        426 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1133255
        Issue’s Table of Contents

      Copyright © 2006 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 11 June 2006

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      Overall Acceptance Rate406of2,067submissions,20%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!