Hostname: page-component-8448b6f56d-dnltx Total loading time: 0 Render date: 2024-04-19T03:43:21.545Z Has data issue: false hasContentIssue false

CPS transformation of flow information

Published online by Cambridge University Press:  27 August 2003

JENS PALSBERG
Affiliation:
Department of Computer Science, Purdue University, W. Lafayette, IN 47907, USA (e-mail: palsberg@cs.purdue.edu)
MITCHELL WAND
Affiliation:
College of Computer Science, Northeastern University, 360 Huntington Avenue, 161CN, Boston, MA 02115, USA (e-mail: wand@ccs.neu.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We consider the question of how a Continuation-Passing-Style (CPS) transformation changes the flow analysis of a program. We present an algorithm that takes the least solution to the flow constraints of a program and constructs in linear time the least solution to the flow constraints for the CPS-transformed program. Previous studies of this question used CPS transformations that had the effect of duplicating code, or of introducing flow sensitivity into the analysis. Our algorithm has the property that for a program point in the original program and the corresponding program point in the CPS-transformed program, the flow information is the same. By carefully avoiding both duplicated code and flow-sensitive analysis, we find that the most accurate analysis of the CPS-transformed program is neither better nor worse than the most accurate analysis of the original. Thus a compiler that needed flow information after CPS transformation could use the flow information from the original program to annotate some program points, and it could use our algorithm to find the rest of the flow information quickly, rather than having to analyze the CPS-transformed program.

Type
Article
Copyright
2003 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.