Results 11  20
of
52
LambdaDropping: Transforming Recursive Equations into Programs with Block Structure
, 2001
"... Lambdalifting a blockstructured program transforms it into a set of recursive equations. We present the symmetric transformation: lambdadropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack ..."
Abstract

Cited by 39 (10 self)
 Add to MetaCart
Lambdalifting a blockstructured program transforms it into a set of recursive equations. We present the symmetric transformation: lambdadropping. Lambdadropping a set of recursive equations restores block structure and lexical scope. For lack
Strongly Typed FlowDirected Representation Transformations (Extended Abstract)
 In ICFP ’97 [ICFP97
, 1997
"... We present a new framework for transforming data representations in a strongly typed intermediate language. Our method allows both value producers (sources) and value consumers (sinks) to support multiple representations, automatically inserting any required code. Specialized representations can be ..."
Abstract

Cited by 29 (13 self)
 Add to MetaCart
We present a new framework for transforming data representations in a strongly typed intermediate language. Our method allows both value producers (sources) and value consumers (sinks) to support multiple representations, automatically inserting any required code. Specialized representations can be easily chosen for particular source/sink pairs. The framework is based on these techniques: 1. Flow annotated types encode the "flowsfrom" (source) and "flowsto" (sink) information of a flow graph. 2. Intersection and union types support (a) encoding precise flow information, (b) separating flow information so that transformations can be well typed, (c) automatically reorganizing flow paths to enable multiple representations. As an instance of our framework, we provide a function representation transformation that encompasses both closure conversion and inlining. Our framework is adaptable to data other than functions.
A Calculus with Polymorphic and Polyvariant Flow Types
"... We present # CIL , a typed #calculus which serves as the foundation for a typed intermediate language for optimizing compilers for higherorder polymorphic programming languages. The key innovation of # CIL is a novel formulation of intersection and union types and flow labels on both terms and ..."
Abstract

Cited by 28 (11 self)
 Add to MetaCart
We present # CIL , a typed #calculus which serves as the foundation for a typed intermediate language for optimizing compilers for higherorder polymorphic programming languages. The key innovation of # CIL is a novel formulation of intersection and union types and flow labels on both terms and types. These flow types can encode polyvariant control and data flow information within a polymorphically typed program representation. Flow types can guide a compiler in generating customized data representations in a strongly typed setting. Since # CIL enjoys confluence, standardization, and subject reduction properties, it is a valuable tool for reasoning about programs and program transformations.
A Typed Intermediate Language for FlowDirected Compilation
, 1997
"... We present a typed intermediate language # CIL for optimizing compilers for functionoriented and polymorphically typed programming languages (e.g., ML). The language # CIL is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow label ..."
Abstract

Cited by 22 (13 self)
 Add to MetaCart
We present a typed intermediate language # CIL for optimizing compilers for functionoriented and polymorphically typed programming languages (e.g., ML). The language # CIL is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed program representation. This flow information can direct optimization.
Constraint Systems for Useless Variable Elimination
, 1998
"... A useless variable is one whose value contributes nothing to the final outcome of a computation. Such variables are unlikely to occur in humanproduced code, but may be introduced by various program transformations. We would like to eliminate useless parameters from procedures and eliminate the corr ..."
Abstract

Cited by 21 (1 self)
 Add to MetaCart
A useless variable is one whose value contributes nothing to the final outcome of a computation. Such variables are unlikely to occur in humanproduced code, but may be introduced by various program transformations. We would like to eliminate useless parameters from procedures and eliminate the corresponding actual parameters from their call sites. This transformation is the extension to higherorder programming of a variety of deadcode elimination optimizations that are important in compilers for firstorder imperative languages. Shivers has presented such a transformation. We reformulate the transformation and prove its correctness. We believe that this correctness proof can be a model for proofs of other analysisbased transformations. We proceed as follows: ffl We reformulate Shivers' analysis as a set of constraints; since the constraints are conditional inclusions, they can be solved using standard algorithms. ffl We prove that any solution to the constraints is sound: that tw...
Optimizing Lazy Functional Programs Using Flow Inference
, 1995
"... . Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant ..."
Abstract

Cited by 20 (5 self)
 Add to MetaCart
. Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant eval and thunk operations, avoiding thunk updates, and allowing the use of unboxed representations of some data. We formulate flow analysis as an inference problem in a type system built using type inclusion constraints and an algorithm for solving these constraints is also given. 1 Introduction Polymorphically typed nonstrict higher order functional programming languages are a boon to the programmer because they provide powerful mechanisms for abstraction [11]. Equally, and for the same reasons, they are very difficult to compile to efficient code. Among the main obstacles are the frequent need to build thunks (representations for unevaluated expressions), test whether objects are thunks o...
The Effectiveness of Flow Analysis for Inlining
 In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming
, 1997
"... An interprocedural flow analysis can justify inlining in higherorder languages. In principle, more inlining can be performed as analysis accuracy improves. This paper compares four flow analyses to determine how effectively they justify inlining in practice. The paper makes two contributions. First ..."
Abstract

Cited by 18 (2 self)
 Add to MetaCart
An interprocedural flow analysis can justify inlining in higherorder languages. In principle, more inlining can be performed as analysis accuracy improves. This paper compares four flow analyses to determine how effectively they justify inlining in practice. The paper makes two contributions. First, the relative merits of the flow analyses are measured with all other variables held constant. The four analyses include two monovariant and two polyvariant analyses that cover a wide range of the accuracy/cost spectrum. Our measurements show that the effectiveness of the inliner improves slightly as analysis accuracy improves, but the improvement is offset by the compiletime cost of the accurate analyses. The second contribution is an improvement to the previously reported inlining algorithm used in our experiments. The improvement causes flow information provided by a polyvariant analysis to be selectively merged. By merging flow information depending on the inlining context, the algorit...
Systematic Realisation of Control Flow Analyses for CML
 In Proceedings of ICFP'97
, 1997
"... We present a methodology for the systematic realisation of control flow analyses and illustrate it for Concurrent ML. We start with an abstract specification of the analysis that is next proved semantically sound with respect to a traditional smallstep operational semantics; this result holds for t ..."
Abstract

Cited by 18 (8 self)
 Add to MetaCart
We present a methodology for the systematic realisation of control flow analyses and illustrate it for Concurrent ML. We start with an abstract specification of the analysis that is next proved semantically sound with respect to a traditional smallstep operational semantics; this result holds for terminating as well as nonterminating programs. The analysis is defined coinductively and it is shown that all programs have a least analysis result (that is indeed the best one). To realise the analysis we massage the specification in three stages: (i) to explicitly record reachability of subexpressions, (ii) to be defined in a syntaxdirected manner, and (iii) to generate a set of constraints that subsequently can be solved by standard techniques. We prove equivalence results between the different versions of the analysis; in particular it follows that the least solution to the constraints generated will be the least analysis result also to the initial specification. 1 Introduction Many c...
Set Constraints for Destructive Array Update Optimization
, 1999
"... Destructive array update optimization is critical for writing scientific codes in functional languages. We present set constraints for an interprocedural update optimization that runs in polynomial time. This is a multipass optimization, involving interprocedural flow analyses for aliasing and live ..."
Abstract

Cited by 14 (1 self)
 Add to MetaCart
Destructive array update optimization is critical for writing scientific codes in functional languages. We present set constraints for an interprocedural update optimization that runs in polynomial time. This is a multipass optimization, involving interprocedural flow analyses for aliasing and liveness. We characterize and prove the soundness of these analyses using smallstep operational semantics. We also prove that any sound liveness analysis induces a correct program transformation.
Analysing, Transforming and Compiling Lazy Functional Programs
, 1997
"... Lazy functional languages such as LML [4], Haskell [36], and Concurrent Clean [58] typically feature first class functions, polymorphic type systems, and automatic garbage collection. These powerful mechanisms translate into short, readable, and reusable programs at a high level of abstraction. They ..."
Abstract

Cited by 12 (4 self)
 Add to MetaCart
Lazy functional languages such as LML [4], Haskell [36], and Concurrent Clean [58] typically feature first class functions, polymorphic type systems, and automatic garbage collection. These powerful mechanisms translate into short, readable, and reusable programs at a high level of abstraction. They do however lead to quite a lot of runtime bookkeeping and make the dynamic flow of control rather unpredictable. This overhead increases execution time by as much as a factor of twenty in some cases. This thesis describes some techniques that can be used to reduce this overhead. Specifically, we eliminate thunk and eval operations, use unboxed data representations and try to avoid updating thunks. These optimizations depend on information gained by a programwide dataflow analysis which is based on a polymorphic subtype inference system. The techniques have been implemented in a compiler for a simple lazy functional language called Plain, and this implementation is described in some deta...