skip to main content
article
Free access

Using dynamic programming to generate optimized code in a Graham-Glanville style code generator

Published: 01 June 1984 Publication History
  • Get Citation Alerts
  • Abstract

    We have performed an investigation of using a dynamic programming to generate optimized code in a Graham-Glanville style code generator We use Earley's algorithm rather than an IR algorithm for parsing in the code generator Not only does the use of Earley's algorithm make the construction of the code generator very easy it allows the selection of optimal code by dynamic programming (using a modification of the technique developed by Lvon) We compare two implementations of this technique to conventional hand-coded code generators using a subset of BASIC as the source language Further we discuss the use of this technique in an experimental C compiler.

    References

    [1]
    Aho, A. V. and Johnson, S. C. "Optimal Code Generation For Expression Trees" JACM 23,3(July 76) 488-501.
    [2]
    Bird, P. L. "An Implementation of a Code Generator Specification Language for Table Driven Code Generators" Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, Boston, Mass. June 23-25, 1982, SIGPLAN Notices 17,6 (June 1982) 44-55.
    [3]
    Cattell, R. G. G. "Automatic Derivation of Code Generators from Machine Descriptions" TOPLAS 2,2 (Apr. 1980) 173-190
    [4]
    Crawford, J. "Engineering a Production Code Generator" Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, Boston, Mass. June 23-25, 1982, SIGPLAN Notices 17,6 (June 1982) 205-215.
    [5]
    Earley, J. "An Efficient Context-Free Parsing Algorithm" CACM 13,2 (Feb 70) 94-102.
    [6]
    Glanville, R. S. "A Machine Independent Algorithm for Code Generation and Its Use in Retargetable Compilers" Phd Dissertation, Univ. of California, Berkeley, 1977.
    [7]
    Graham, S. L. "Table-Driven Code Generation" Computer, 13,8 (Aug. 1980) 25-34.
    [8]
    Graham, S. L., Henry, R. R., Schulman, R. A. "An Experiment in Table Driven Code Generation" Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, Boston, Mass. June 23-25, 1982, SIGPLAN Notices 17,6 (June 1982) 32-43.
    [9]
    Johnson, S. C. "A Portable Compiler: Theory and Practice" Proceedings of the Fifth ACM Symposium on Principles of Programming Languages, Jan 1978.
    [10]
    Krumme, D. W., Ackley, D. H. "A Practical Method for Code Generation Based on Exhaustive Search" Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, Boston, Mass. June 23-25, 1982, SIGPLAN Notices 17,6 (June 1982) 185-196.
    [11]
    Landwehr, R., Jansohn, H-S, Goos, G. "Experience with an Automatic Code Generator Generator" Proceedings of the SIGPLAN '82 Symposium on Compiler Construction, Boston, Mass. June 23-25, 1982, SIGPLAN Notices 17,6 (June 1982) 56-66.
    [12]
    Lyon, G. "Syntax-Directed Least-Errors Analysis for Context Free Languages: A Practical Approach" CACM 17,1 (Jan 74) 3-14.

    Cited By

    View all

    Index Terms

    1. Using dynamic programming to generate optimized code in a Graham-Glanville style code generator
      Index terms have been assigned to the content through auto-classification.

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 19, Issue 6
      Proceedings of the SIGPLAN '84 symposium on compiler construction
      June 1984
      318 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/502949
      Issue’s Table of Contents
      • cover image ACM Conferences
        SIGPLAN '84: Proceedings of the 1984 SIGPLAN symposium on Compiler construction
        June 1984
        328 pages
        ISBN:0897911393
        DOI:10.1145/502874

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 01 June 1984
      Published in SIGPLAN Volume 19, Issue 6

      Check for updates

      Author Tags

      1. Code Generation
      2. Compiling
      3. Dynamic Programming
      4. Earley's Algorithm
      5. Graham-Glanville

      Qualifiers

      • Article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)64
      • Downloads (Last 6 weeks)25
      Reflects downloads up to 14 Aug 2024

      Other Metrics

      Citations

      Cited By

      View all

      View Options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Get Access

      Login options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media