## Copy elimination in functional languages (1989)

### Cached

### Download Links

- [drona.csa.iisc.ernet.in]
- [drona.csa.iisc.ernet.in]
- [drona.csa.iisc.ernet.in]
- DBLP

### Other Repositories/Bibliography

Venue: | in: POPL ’89: Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages |

Citations: | 18 - 0 self |

### BibTeX

@INPROCEEDINGS{Gopinath89copyelimination,

author = {K. Gopinath and John L. Hennessy},

title = {Copy elimination in functional languages},

booktitle = {in: POPL ’89: Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages},

year = {1989},

pages = {303--314}

}

### Years of Citing Articles

### OpenURL

### Abstract

Copy elimination is an important optimization for compiling functional languages. Copies arise because these languages lack the concepts of state and variable; hence updating an object involves a copy in a naive implementation. Copies are also possible if proper targeting has not been carried out inside functions and across function calls. Targeting is the proper selection of a storage area for evaluating an expression. By abstracting a collection of functions by a target operator, we compute targets of function bodies that can then be used to define an optimized interpreter to eliminate copies due to updates and copies across function calls. The language we consider is typed lambda calculus with higherorder functions and special constructs for array operations. Our approach can eliminate copies in divide and conquer problems like quicksort and bitonic sort that previous approaches could not handle. We also present some results of implementing a compiler for a single assignment language called SAL on some small but tough programs. Our results indicate that it is possible to approach a performance comparable to imperative languages like Pascal. 1

### Citations

300 |
A Compiler for VLIW Architectures
- Ellis
- 1984
(Show Context)
Citation Context ...r matrices 8 queens: Finds all the 92 solutions. NEWRZ: a time-critical routine from SIMPLE that is used for hydrodynamic calculations. It is a transliteration of the NEWRZ program considered by Ellis=-=[4]-=- CYK: the Cocke-Younger-Kasami algorithm parses an input string of 128 a’s for the folIowing ambiguous grammar: A+a A+AA Puzzle: finds the solution to a three-dimensional puzzle. This is a highly recu... |

212 | Abstract interpretation
- Cousot
- 1996
(Show Context)
Citation Context ... and doing updates in-place. Our work concerns itself with the copy elimination that results from the last two parts. Using abstract interpretation, a technique that was pioneered by Cousot and Cousot=-=[12]-=- for deriving properties of programs, Mycroft[10] considered the problem of detecting when a call-by-need argument can be turned into a call-byvalue argument in the interests of efficiency. Hudak[7] h... |

139 |
Principles of Compiler Design
- AHO, ULLMAN
- 1977
(Show Context)
Citation Context ... 1 Introduction Copy elimination is an important optimization for implementing functional languages. Though it is related to the problem of copy propagation that has been considered in many compilers =-=[1]-=-, the term is used in a more general context where structured values can be updated, copies can be eliminated across function calls and the computation tree can be reordered. Because of these addition... |

93 |
Abstract Interpretation a d Optimising Transformation f rAp- plicative programs
- Mycroft
- 1981
(Show Context)
Citation Context ...self with the copy elimination that results from the last two parts. Using abstract interpretation, a technique that was pioneered by Cousot and Cousot[12] for deriving properties of programs, Mycroft=-=[10]-=- considered the problem of detecting when a call-by-need argument can be turned into a call-byvalue argument in the interests of efficiency. Hudak[7] has also used the technique of abstract interpreta... |

69 | A semantic model of reference counting and its abstraction
- Hudak
- 1986
(Show Context)
Citation Context ...t[l2] for deriving properties of programs, Mycroft[lO] considered the problem of detecting when a call-by-need argument can be turned into a call-byvalue argument in the interests of efficiency. Hudak=-=[7]-=- has also used the technique of abstract interpretation successfully to detect updates that can be done in-place by reference counting when call-by-value arguments are used. However, his approach conq... |

46 |
The aggregate update problem in functional programming systems
- Hudak, Bloss
- 1985
(Show Context)
Citation Context ...rgeting is the proper selection of a storage area for evaluating an expression. A good selection of targets reduces the number of intermediate copies since temporaries may not besneeded. Previous work=-=[8, 7]-=- on copy elimination has concentrated on doing updates in-place but this is not enough in tackling divide and conquer problems. Consider the following simple divide and conquer schema (where cat is th... |

21 |
Higher-order strictness analysis for untyped lambda calculus
- Hudak, Young
- 1986
(Show Context)
Citation Context ...vv = least fixed point (λtenv.tenv[· · · , fi ← λxi.T ˙ [ei ]tenv[ xi/xi], ˙ · · ·]) Even though we have higher-order functions, we do not need “target pairs” (like “alias pairs” or “strictness pairs”=-=[2, 11, 9]-=-) since the target of each of the constructs is the same whether used as a value or function. Most of the above equations are straightforward. The first three cases concern scalars and these do not ma... |

15 |
Path semantics
- Bloss, Hudak
(Show Context)
Citation Context ...y-value evaluation above but by suitably modifying occr, we can change the evaluation to callby-need and other evaluation mechanisms. The above approach is similar to path semantics of Bloss and Hudak=-=[3]-=-. The computation of these sequences requires one pass over the functions. The predicate notlive checks if there is some OCCUrrenCe 2ik after a given occurrence 2ij in Some evaluation sequence. In the... |

10 |
Copy Elimination in Single Assignment Languages
- Gopinath
- 1988
(Show Context)
Citation Context ... get simple targets for sorl and sb only if we assume the evaluation order for upd to be from right to left (this can be seen in the definition of occ). If this is not the case, temporary inbrod~ction=-=[6]-=- is needed to eliminate interfering live-ranges. 9.3 Higher-order Exarnple g(a,b)=a h(a,b)=b if cond2 then cat(upd(gl(a,b),il,vl), upd(b,iz,vz)) else cat(gl(u,b),upd(gz(a,b),i3,03)) else f(upd(a,i4,21... |

10 |
A.J.Demers. Computation of aliases and support sets
- Neirynck
- 1987
(Show Context)
Citation Context ...vv = least fixed point (λtenv.tenv[· · · , fi ← λxi.T ˙ [ei ]tenv[ xi/xi], ˙ · · ·]) Even though we have higher-order functions, we do not need “target pairs” (like “alias pairs” or “strictness pairs”=-=[2, 11, 9]-=-) since the target of each of the constructs is the same whether used as a value or function. Most of the above equations are straightforward. The first three cases concern scalars and these do not ma... |

8 | An algebraic model for divideand-conquer and its parallelism
- Mou, Hudak
- 1988
(Show Context)
Citation Context ...d conquer problems, much of the analysis can be avoided if this idiom can be incorporated in the language by a special construct. This actually has been proposed by some recent work at Yale University=-=[15]-=-. It remains to be seen whether any other such constructs are needed to avoid expensive analysis for copy elimination. 14 Acknowledgements We would like to thank Paul Hudak, Adrienne Bloss, Daniel Wei... |

3 |
Static Analysis of Aliases and Side Effects in Higher-Order languages
- Neirynck
- 1988
(Show Context)
Citation Context ...vv = least fixed point (λtenv.tenv[· · · , fi ← λxi.T ˙ [ei ]tenv[ xi/xi], ˙ · · ·]) Even though we have higher-order functions, we do not need “target pairs” (like “alias pairs” or “strictness pairs”=-=[2, 11, 9]-=-) since the target of each of the constructs is the same whether used as a value or function. Most of the above equations are straightforward. The first three cases concern scalars and these do not ma... |

2 |
Theory of Computation
- Mathematical
- 1974
(Show Context)
Citation Context .... ˙ xi ˙ where xi is of array type and i ≤ m, then e can be targeted to xi and xi updated in-place in e to give the value of e. Proof: The proof is by a combination of complete computational induction=-=[16]-=- on the number of arrows and structural induction on E. The proof is given in the appendix. Corollary 1 If T applied to the body of the function fp is ˙x where x is an array bound variable, then the v... |

1 |
Reduction with Super-combinators
- Graph
- 1982
(Show Context)
Citation Context ...mbda term is present as an argument to a function, any free variable is changed to a bound variable and the free variable passed as an extra argument to the function. This is similar to lambda-lifting=-=[13]-=- to reduce the number of reductions. We also assume thefollowing abbreviations: λx, y. e for λx.λy. e and f (x,y) for app(app(f,x),y). • Let the kth function call of fi and the functional parameter f... |

1 |
A SingleAssignment Language for Parallel Algorithms
- SAL
- 1981
(Show Context)
Citation Context ...nvstd ststd ≈ Estd,es [e]envstd ststd A compiler for a substantial part of SAL has been implemented to verify the effectiveness of the approach. SAL is a single assignment language defined at Stanford=-=[14]-=- and provides iteration, parametric types and streams with scoping mechanisms similar to Algol languages but does not have higher-order functions. It has many features that are found in comparable lan... |

1 |
Principles of Compiler sign
- Aho, Ullman
- 1977
(Show Context)
Citation Context ... 1 Introduction Copy elimination is an important optimization for implementing functional languages. Though it is related to the problem of copy propagation that has been considered in many compilers =-=[l]-=-, the term is used in a more general context where structured values can be updated, copies can be eliminated across function calls and the computation tree can be reordered. Because of these addition... |

1 | theory of computation - McGraw-Hill - 1974 |

1 | A.J.Demers. Corn.putation of aliases and support sets - Neirynck - 1987 |

1 |
Interprocedural analysis in the presence of pointers, procedure variables, and label variables
- Weihl
- 1980
(Show Context)
Citation Context ...t exponential. This is due to use of extensional equality for functional terms in the fixpoint iteration. Further, collecting all the possible values for a functional parameter has been shown by Weihl=-=[5]-=- to be P-space hard. However, we believe that the average behaviour is much better. Neirynck[ll] shows that for the first-order case, type information can be used to guess the correct fixpoint. Howeve... |