TY - JOUR
T1 - Constructed product result analysis for Haskell
AU - Baker-Finch, Clem
AU - Glynn, Kevin
AU - Peyton Jones, Simon
PY - 2004/3
Y1 - 2004/3
N2 - 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.
AB - 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.
UR - http://www.scopus.com/inward/record.url?scp=1142291628&partnerID=8YFLogxK
U2 - 10.1017/S0956796803004751
DO - 10.1017/S0956796803004751
M3 - Article
SN - 0956-7968
VL - 14
SP - 211
EP - 245
JO - Journal of Functional Programming
JF - Journal of Functional Programming
IS - 2
ER -