Author:
BAKER-FINCH CLEM,GLYNN KEVIN,JONES SIMON PEYTON
Abstract
Compilers for ML and Haskell typically go to a good deal of trouble to arrange that multiple arguments can be passed efficiently to a procedure. For some reason, less effort seems to be invested in ensuring that multiple results can also be returned efficiently. In the context of the lazy functional language Haskell, we describe an analysis, Constructed Product Result (CPR) analysis, that determines when a function can profitably return multiple results in registers. The analysis is based only on a function's definition, and not on its uses (so separate compilation is easily supported) and the results of the analysis can be expressed by a transformation of the function definition alone. We discuss a variety of design issues that were addressed in our implementation, and give measurements of the effectiveness of our approach across a substantial benchmark set. Overall, the price/performance ratio is good: the benefits are modest in general (though occasionally dramatic), but the costs in both complexity and compile time, are low.
Publisher
Cambridge University Press (CUP)
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Compiling without continuations;ACM SIGPLAN Notices;2017-09-14
2. Compiling without continuations;Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation;2017-06-14
3. Optimizing SYB traversals is easy!;Science of Computer Programming;2015-11
4. Harmonizing classes, functions, tuples, and type parameters in virgil iii;ACM SIGPLAN Notices;2013-06-23