Analyzing binding extent in 3CPS

Author:

Quiring Benjamin1ORCID,Reppy John2ORCID,Shivers Olin3ORCID

Affiliation:

1. University of Maryland, USA

2. University of Chicago, USA

3. Northeastern University, USA

Abstract

To date, the most effective approach to compiling strict, higher-order functional languages (such as OCaml, Scheme, and SML) has been to use whole-program techniques to convert the program to a first-order monomorphic representation that can be optimized using traditional compilation techniques. This approach, popularized by MLton, has limitations, however. We are interested in exploring a different approach to compiling such languages, one that preserves the higher-order and polymorphic character of the program throughout optimization. To enable such an approach, we must have effective analyses that both provide precise information about higher-order programs and that scale to larger units of compilation. This paper describes one such analysis for determining the extent of variable bindings. We classify the extent of variables as either register (only one binding instance can be live at any time), stack (the lifetimes of binding instances obey a LIFO order), or heap (binding lifetimes are arbitrary). These extents naturally connect variables to the machine resources required to represent them. We believe that precise information about binding extents will enable efficient management of environments, which is a key problem in the efficient compilation of higher-order programs. At the core of the paper is the 3CPS intermediate representation, which is a factored CPS-based intermediate representation (IR) that statically marks variables to indicate their binding extent. We formally specify the management of this binding structure by means of a small-step operational semantics and define a static analysis that determines the extents of the variables in a program. We evaluate our analysis using a standard suite of SML benchmark programs. Our implementation gets surprisingly high yield and exhibits scalable performance. While this paper uses a CPS-based IR, the algorithm and results are easily transferable to other λ-calculus IRs, such as ANF.

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference33 articles.

1. Alfred V. Aho , Monica S. Lam , Ravi Sethi , and Jeffrey D . Ullman . 2007 . Compilers : Principles, Techniques and Tools (2nd ed.). Pearson, New York City, New York, USA. Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman. 2007. Compilers: Principles, Techniques and Tools (2nd ed.). Pearson, New York City, New York, USA.

2. Andrew W. Appel . 1992. Compiling with Continuations . Cambridge University Press , Cambridge, England, UK . Andrew W. Appel. 1992. Compiling with Continuations. Cambridge University Press, Cambridge, England, UK.

3. Andrew W. Appel and Trevor T.Y . Jim . 1988 . Optimizing Closure Environment Representations. Department of Computer Science, Princeton University . https://www.cs.princeton.edu/research/techreps/TR-168-88 Andrew W. Appel and Trevor T.Y. Jim. 1988. Optimizing Closure Environment Representations. Department of Computer Science, Princeton University. https://www.cs.princeton.edu/research/techreps/TR-168-88

4. Escape analysis

5. Compiling a functional language

Cited by 1 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Generating Well-Typed Terms That Are Not “Useless”;Proceedings of the ACM on Programming Languages;2024-01-05

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3