skip to main content
10.1145/292540.292562acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

Optimal code selection in DAGs

Authors Info & Claims
Published:01 January 1999Publication History

ABSTRACT

We extend the tree parsing approach to code selection to DAGs. In general, our extension does not produce the optimal code selection for all DAGs (this problem would be NP-complete), but for certain code selection grammars, it does. We present a method for checking whether a code selection grammar belongs to this set of DAG-optimal grammars, and use this method to check code selection grammars adapted from lcc: the grammars for the MIPS and SPARC architectures are DAG-optimal, and the code selection grammar for the 386 architecture is almost DAG-optimal.

References

  1. BDB90.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. BE91.John Boyland and Helmut Emmelmann. Discussion: Code generator specification techniques (summary). In Robert Giegerich and Susan L. Graham, editors, Code Generation -- Concepts, Tools, Techniques, Workshops in Computing, pages 66-69. Springer, 1991.Google ScholarGoogle Scholar
  3. Cha87.David R. Chase. An improvement to bottomup tree pattern matching. In Fourteenth Annual A CM Symposium on Principles of Programming Languages, pages 168-177, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. DF84.Jack W. Davidson and Christopher W. Fraser. Code selection through object code optimization. A CM 7~nsactions on Programming Languages and Systems, 6(4):505-526, October 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. EP97.M. Anton Ertl and Christian Pirker. The structure of a Forth native code compiler. In EuroForth '97 Conference Proceedings, pages 107-116, Oxford, 1997.Google ScholarGoogle Scholar
  6. ESL89.Helmut Emmelmann, Friedrich-Wilhelm SchrSer, 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
  7. FH91.Christopher W. Fraser and David R. Hanson. A code generation interface for ANSI C. Software~ Practice and Experience, 21(9):963-988, September 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. FH95.Christopher Fraser and David Hanson. A Retargetable C compiler: Design and implementation. Benjamin/Cummings Publishing, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. FHP93.Christopher W. Fraser, David R. Hanson, and Todd A. Proebsting. Engineering a simple, efficient code generator generator. A CM Letters on Programming Languages and Systems, 1993. Available from ftp: / / ft p. cs. princet on. edu/pub/ib urg. tar. Z. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Pro95.Todd A. Proebsting. BURS automata generation. A CM Transactions on Programming Languages and Systems, 17(3):461-486, May 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Pro98.Todd Proebsting. Least-cost instruction selection in DAGs is NP-complete. http://research, microsoft.corn/toddpro/papers/proof.htm, 1998.Google ScholarGoogle Scholar
  12. PW96.Todd A. Proebsting and Benjamin R. Whaley. One-pass, optimal tree parsing- with or without trees. In Tibor GyimSthy, editor, Compiler Construction (CC'96), pages 294-308, LinkSping, 1996. Springer LNCS 1060. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Wen90.Alan L. Wendt. Fast code generation using automatically-generated decision trees. In SIG- PLAN '90 Conference on Programming Language Design and implementation, pages 9-15, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Optimal code selection in DAGs

            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
              POPL '99: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
              January 1999
              324 pages
              ISBN:1581130953
              DOI:10.1145/292540

              Copyright © 1999 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 January 1999

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • Article

              Acceptance Rates

              POPL '99 Paper Acceptance Rate24of136submissions,18%Overall Acceptance Rate824of4,130submissions,20%

              Upcoming Conference

              POPL '25

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader