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.
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Christopher W. Fraser and David R. Hanson. A retargetable compiler for ANSI C. SIGPLAN Notices, 26(10):29--43, October 1991. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Christopher Fraser and David Hanson. A Retargetable C compiler: Design and Implementation. Benjamin/Cummings Publishing, 1995. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Jan Heering, Paul Klint, and Jan Reekers. Incremental generation of parsers. IEEE Transactions on Software Engineering, 16(12):1344--1351, December 1990. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Todd A. Proebsting. BURS automata generation. ACM Transactions on Programming Languages and Systems, 17(3):461--486, May 1995. Google Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
Fast and flexible instruction selection with on-demand tree-parsing automata
Recommendations
Fast and flexible instruction selection with on-demand tree-parsing automata
Proceedings of the 2006 PLDI ConferenceTree 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; ...
Fast and flexible instruction selection with constraints
CC 2018: Proceedings of the 27th International Conference on Compiler ConstructionTree-parsing instruction selection as used in, e.g., lcc, uses dynamic costs to gain flexibility and handle situations (such as read-modify-write instructions) that do not fit into the basic tree-parsing model. The disadvantage of dynamic costs is that ...







Comments