scispace - formally typeset
Search or ask a question
Author

Stephen Weeks

Bio: Stephen Weeks is an academic researcher from Carnegie Mellon University. The author has contributed to research in topics: Functional programming & Compiler. The author has an hindex of 9, co-authored 10 publications receiving 308 citations.

Papers
More filters
Proceedings ArticleDOI
25 Jan 1995
TL;DR: The framework makes explicit use of flow graphs for modeling control and data flow properties of untyped higher-order programs, and can express a hierarchy of analyses with different cost/accuracy tradeoffs.
Abstract: We describe a framework for flow analysis in higher-order languages. It is both a synthesis and extension of earlier work in this area, most notably [20, 22]The framework makes explicit use of flow graphs for modeling control and data flow properties of untyped higher-order programs. The framework is parameterized, and can express a hierarchy of analyses with different cost/accuracy tradeoffs. The framework is also amenable to a direct, efficient implementation.We develop several instantiations of the framework, and prove their running-time complexity. In addition, we use the simplest instantiation to demonstrate the equivalence of a 0CFA style analysis and the set-based analysis of [8].

115 citations

Book ChapterDOI
02 Apr 2000
TL;DR: Experimental results over a range of benchmarks including large real-world programs such as the compiler itself and the ML-Kit indicate that the compile-time cost of flow analysis and closure conversion is extremely small, and that the dispatches and coercions inserted by the algorithm are dynamically infrequent.
Abstract: This paper presents a new closure conversion algorithm for simply-typed languages. We have have implemented the algorithm as part of MLton, a whole-program compiler for Standard ML (SML). MLton first applies all functors and eliminates polymorphism by code duplication to produce a simply-typed program. MLton then performs closure conversion to produce a first-order, simply-typed program. In contrast to typical functional language implementations, MLton performs most optimizations on the first-order language, after closure conversion. There are two notable contributions of our work: 1. The translation uses a general flow-analysis framework which includes OCFA. The types in the target language fully capture the results of the analysis. MLton uses the analysis to insert coercions to translate between different representations of a closure to preserve type correctness of the target language program. 2. The translation is practical. Experimental results over a range of benchmarks including large real-world programs such as the compiler itself and the ML-Kit [25] indicate that the compile-time cost of flow analysis and closure conversion is extremely small, and that the dispatches and coercions inserted by the algorithm are dynamically infrequent.

59 citations

Proceedings ArticleDOI
01 Oct 2001
TL;DR: This paper gives a formal presentation of contification in MLton, a whole-program optimizing Standard ML compiler, as well as a new algorithm based on the dominator tree of a program's call graph that is optimal.
Abstract: Contification is a compiler optimization that turns a function that always returns to the same place into a continuation. Compilers for functional languages use contification to expose the control-flow information that is required by many optimizations, including traditional loop optimizations. This paper gives a formal presentation of contification in MLton, a whole-program optimizing Standard ML compiler. We present two existing algorithms for contification in our framework, as well as a new algorithm based on the dominator tree of a program's call graph. We prove that the dominator algorithm is optimal. We present benchmark results on realistic SML programs demonstrating that contification has minimal overhead on compile time and significantly improves run time.

33 citations

Proceedings ArticleDOI
01 Jul 1994
TL;DR: An analysis of a parallel language in which processes communicate via first-class mutable shared locations, facilitating a number of important optimizations related to synchronization, processor/thread mapping, and storage management is described.
Abstract: We describe an analysis of a parallel language in which processes communicate via first-class mutable shared locations. The sequential core of the language defines a higher-order strict functional language with list data structures. The parallel extensions permit processes and shared locations to be dynamically created; synchronization among processes occurs exclusively via shared locations.The analysis is defined by an abstract interpretation on this language. The interpretation is efficient and useful, facilitating a number of important optimizations related to synchronization, processor/thread mapping, and storage management.

28 citations

Book ChapterDOI
08 Sep 1997
TL;DR: A polyvariant flow analysis framework for the predicative subset of system F, a common basis for typed intermediate languages, is presented and it is proved that SRT respects types.
Abstract: Flow analysis is especially valuable for optimizing functional languages because control-flow information is not syntactically apparent in higher-order programs. Flow analyses typically operate on untyped languages. However, recent compilers for typed functional languages such as ML and Haskell use a typed intermediate language to expose data representations for optimization. This paper presents a polyvariant flow analysis framework for the predicative subset of system F, a common basis for typed intermediate languages. Analyses in this framework can take advantage of types to analyze programs more precisely. We study a specific analysis called SRT that uses types to control polyvariance. We prove that SRTrespects types: whenever it assigns abstract value \(\hat \upsilon\)to a variable and the type system assigns type σ to the same variable, then \(\left[ {\hat \upsilon } \right] \subseteq \left[ \sigma \right]\), where [ · ] denotes a set of values. SRT does not terminate 1569 1655 V 3 for some programs. We present several variants of SRT that are better suited to practical use.

26 citations


Cited by
More filters
Book
22 Oct 1999
TL;DR: This book is unique in providing an overview of the four major approaches to program analysis: data flow analysis, constraint-based analysis, abstract interpretation, and type and effect systems.
Abstract: Program analysis utilizes static techniques for computing reliable information about the dynamic behavior of programs. Applications include compilers (for code improvement), software validation (for detecting errors) and transformations between data representation (for solving problems such as Y2K). This book is unique in providing an overview of the four major approaches to program analysis: data flow analysis, constraint-based analysis, abstract interpretation, and type and effect systems. The presentation illustrates the extensive similarities between the approaches, helping readers to choose the best one to utilize.

1,955 citations

Proceedings ArticleDOI
09 Oct 1997
TL;DR: In this paper, a parameterized algorithmic framework for call graph construction in the presence of message sends and/or first class functions is presented, which is used to describe and implement a number of well-known and new algorithms.
Abstract: Interprocedural analyses enable optimizing compilers to more precisely model the effects of non-inlined procedure calls, potentially resulting in substantial increases in application performance Applying interprocedural analysis to programs written in object-oriented or functional languages is complicated by the difficulty of constructing an accurate program call graph This paper presents a parameterized algorithmic framework for call graph construction in the presence of message sends and/or first class functions We use this framework to describe and to implement a number of well-known and new algorithms We then empirically assess these algorithms by applying them to a suite of medium-sized programs written in Cecil and Java, reporting on the relative cost of the analyses, the relative precision of the constructed call graphs, and the impact of this precision on the effectiveness of a number of interprocedural optimizations

338 citations

Journal ArticleDOI
TL;DR: A general parameterized algorithm is presented that encompasses many well-known and novel call graph construction algorithms and is implemented in the Vortex compiler infrastructure, a mature, multilanguage, optimizing compiler.
Abstract: A large number of call graph construction algorithms for object-oriented and functional languages have been proposed, each embodying different tradeoffs between analysis cost and call graph precision. In this article we present a unifying framework for understanding call graph construction algorithms and an empirical comparison of a representative set of algorithms. We first present a general parameterized algorithm that encompasses many well-known and novel call graph construction algorithms. We have implemented this general algorithm in the Vortex compiler infrastructure, a mature, multilanguage, optimizing compiler. The Vortex implementation provides a "level playing field" for meaningful cross-algorithm performance comparisons. The costs and benefits of a number of call graph construction algorithms are empirically assessed by applying their Vortex implementation to a suite of sizeable (5,000 to 50,000 lines of code) Cecil and Java programs. For many of these applications, interprocedural analysis enabled substantial speed-ups over an already highly optimized baseline. Furthermore, a significant fraction of these speed-ups can be obtained through the use of a scalable, near-linear time call graph construction algorithm.

283 citations

Proceedings ArticleDOI
01 Oct 2000
TL;DR: Surprisingly, for detecting unreachable methods, the inexpensive RTA algorithm does almost as well as the seemingly more powerful algorithms, and one of the new algorithms obtains the current best tradeoff between speed and precision.
Abstract: Propagation-based call graph construction algorithms have been studied intensively in the 199Os, and differ primarily in the number of sets that are used to approximate run-time values of expressions. In practice, algorithms such as RTA that use a single set for the whole program scale well. The scalability of algorithms such as 0-CFA that use one set per expression remains doubtful.In this paper, we investigate the design space between RTA and 0-CFA. We have implemented various novel algorithms in the context of Jax, an application extractor for Java, and shown that they all scale to a 325,000-line program. A key property of these algorithms is that they do not analyze values on the run-time stack, which makes them efficient and easy to implement. Surprisingly, for detecting unreachable methods, the inexpensive RTA algorithm does almost as well as the seemingly more powerful algorithms. However, for determining call sites with a single target, one of our new algorithms obtains the current best tradeoff between speed and precision.

275 citations

Proceedings ArticleDOI
21 Jan 1998
TL;DR: This expository paper simplifies and clarifies Steffen's depiction of data flow analysis (d.f.a.) as model checking: by employing abstract interpretation (a.i.) to generate program traces and by utilizing Kozen's modal mu-calculus to express trace properties, it is expressed in simplest possible terms that a d.
Abstract: This expository paper simplifies and clarifies Steffen's depiction of data flow analysis (d.f.a.) as model checking: By employing abstract interpretation (a.i.) to generate program traces and by utilizing Kozen's modal mu-calculus to express trace properties, we express in simplest possible terms that a d.f.a. is a model check of a program's a.i. trace. In particular, the classic flow equations for bit-vector-based d.f.a.s reformat trivially into modal mu-Calculus formulas. A surprising consequence is that two of the classical d.f.a.s are exposed as unsound; this problem is analyzed and simply repaired. In the process of making the above discoveries, we clarify the relationship between a.i. and d.f.a. in terms of the often-misunderstood notion of collecting semantics and we highlight how the research areas of flow analysis, abstract interpretation, and model checking have grown together.

218 citations