×

On sparse evaluation representations. (English) Zbl 0996.68131

The sparse evaluation graph has emerged over the past several years as an intermediate representation that captures the dataflow information in a program compactly and helps perform dataflow analysis efficiently. The contributions of this paper are three-fold: We present a linear time algorithm for constructing a variant of the sparse evaluation graph for any dataflow analysis problem. Our algorithm has two advantages over previous algorithms for constructing sparse evaluation graphs. First, it is simpler to understand and implement. Second, our algorithm generates a more compact representation than the one generated by previous algorithms. (Our algorithm is also as efficient as the most efficient known algorithm for the problem.) We present a formal definition of an equivalent flow graph, which attempts to capture the goals of sparse evaluation. We present a quadratic algorithm for constructing an equivalent flow graph consisting of the minimum number of vertices possible. We show that the problem of constructing an equivalent flow graph consisting of the minimum number of vertices and edges is NP-hard. We generalize the notion of an equivalent flow graph to that of a partially equivalent flow graph, an even more compact representation, utilizing the fact that the dataflow solution is not required at every node of the control-flow graph. We also present an efficient linear time algorithm for constructing a partially equivalent flow graph.

MSC:

68R10 Graph theory (including graph drawing) in computer science
Full Text: DOI

References:

[1] Bergstra, J. A.; Dinesh, T. B.; Field, J.; Heering, J., Towards a complete transformational toolkit of compilers, ACM Trans. Programming Languages System, 19, 5, 639-684 (1997)
[2] J.-D. Choi, M. Burke, P. Carini, Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects, Conf. Record of the 20th ACM Symp. on Principles of Programming Languages, 1993, pp. 232-245.; J.-D. Choi, M. Burke, P. Carini, Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects, Conf. Record of the 20th ACM Symp. on Principles of Programming Languages, 1993, pp. 232-245.
[3] J.-D. Choi, R. Cytron, J. Ferrante, Automatic construction of sparse data flow evaluation graphs, Conf. Record of the 18th ACM Symp. on Principles of Programming Languages, 1991, pp. 55-66.; J.-D. Choi, R. Cytron, J. Ferrante, Automatic construction of sparse data flow evaluation graphs, Conf. Record of the 18th ACM Symp. on Principles of Programming Languages, 1991, pp. 55-66.
[4] Cormen, T. H.; Leiserson, C. E.; Rivest, R. L., Introduction to Algorithms (1990), MIT Press: MIT Press Cambridge, MA · Zbl 1158.68538
[5] Cytron, R.; Ferrante, J., Efficiently computing \(φ\)-nodes on-the-fly, (Banerjee, U.; Gelernter, D.; Nicolau, A.; Padua, D., Languages and Compilers for Parallel Computing, Lecture Notes in Computer Science, Vol. 768 (1993), Springer: Springer Berlin), 461-476 · Zbl 0825.00105
[6] R. Cytron, J. Ferrante, B.K. Rosen, M.N. Wegman, F.K. Zadeck, An efficient method for computing static single assignment form, Conf. Record of the 16th ACM Symp. on Principles of Programming Languages, 1989, pp. 25-35.; R. Cytron, J. Ferrante, B.K. Rosen, M.N. Wegman, F.K. Zadeck, An efficient method for computing static single assignment form, Conf. Record of the 16th ACM Symp. on Principles of Programming Languages, 1989, pp. 25-35.
[7] Cytron, R.; Ferrante, J.; Rosen, B. K.; Wegman, M. N.; Zadeck, F. K., Efficiently computing static single assignment form and control dependence graph, ACM Trans. Programming Languages Systems, 13, 4, 452-490 (1991)
[8] D.M. Dhamdere, B.K. Rosen, F.K. Zadeck, How to analyze large programs efficiently and informatively, Proc. SIGPLAN’92 Conf. on Programming Language Design and Implementation, 1992, pp. 212-223.; D.M. Dhamdere, B.K. Rosen, F.K. Zadeck, How to analyze large programs efficiently and informatively, Proc. SIGPLAN’92 Conf. on Programming Language Design and Implementation, 1992, pp. 212-223.
[9] E. Duesterwald, R. Gupta, M.L. Soffa, Reducing the cost of data flow analysis by congruence partitioning, Internat. Conf. on Compiler Construction, Lecture Notes in Computer Science, Vol. 786, Springer, Berlin, 1994, pp. 357-373.; E. Duesterwald, R. Gupta, M.L. Soffa, Reducing the cost of data flow analysis by congruence partitioning, Internat. Conf. on Compiler Construction, Lecture Notes in Computer Science, Vol. 786, Springer, Berlin, 1994, pp. 357-373.
[10] J. Field, A simple rewriting semantics for realistic imperative programs and its application to program analysis (preliminary report), Proc. ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, June 1992, pp. 98-107. Proceedings published as Yale University Tech. Report YALEU/DCS/RR-909.; J. Field, A simple rewriting semantics for realistic imperative programs and its application to program analysis (preliminary report), Proc. ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, June 1992, pp. 98-107. Proceedings published as Yale University Tech. Report YALEU/DCS/RR-909.
[11] Graham, S. L.; Wegman, M., A fast and usually linear algorithm for global dataflow analysis algorithm, J. ACM, 23, 1, 172-202 (1976) · Zbl 0326.68023
[12] R. Johnson, D. Pearson, K. Pingali, The program tree structure: computing control regions in linear time, Proc. SIGPLAN ’94 Conf. on Programming Language Design and Implementation, 1994, pp. 171-185.; R. Johnson, D. Pearson, K. Pingali, The program tree structure: computing control regions in linear time, Proc. SIGPLAN ’94 Conf. on Programming Language Design and Implementation, 1994, pp. 171-185.
[13] R. Johnson, K. Pingali, Dependence-based program analysis, Proc. SIGPLAN ’93 Conf. on Programming Language Design and Implementation, 1993, pp. 78-89.; R. Johnson, K. Pingali, Dependence-based program analysis, Proc. SIGPLAN ’93 Conf. on Programming Language Design and Implementation, 1993, pp. 78-89.
[14] G. Kildall, A unified approach to global program optimization, Conf. Record of the 1st ACM Symp. on Principles of Programming Languages, ACM, New York, NY, 1973, pp. 194-206.; G. Kildall, A unified approach to global program optimization, Conf. Record of the 1st ACM Symp. on Principles of Programming Languages, ACM, New York, NY, 1973, pp. 194-206. · Zbl 0309.68020
[15] W. Landi, B. Ryder, A safe approximate algorithm for interprocedural pointer aliasing. Proc. SIGPLAN ’92 Conf. on Programming Language Design and Implementation, 1992, pp. 235-248.; W. Landi, B. Ryder, A safe approximate algorithm for interprocedural pointer aliasing. Proc. SIGPLAN ’92 Conf. on Programming Language Design and Implementation, 1992, pp. 235-248.
[16] K. Pingali, G. Bilardi, Apt: a data structure for optimal control dependence computation, Proc. SIGPLAN ’95 Conf. on Programming Language Design and Implementation, 1995, pp. 32-46.; K. Pingali, G. Bilardi, Apt: a data structure for optimal control dependence computation, Proc. SIGPLAN ’95 Conf. on Programming Language Design and Implementation, 1995, pp. 32-46.
[17] Pingali, K.; Bilardi, G., Optimal control dependence computation and the roman chariots problem, ACM Trans. Programming Languages Systems, 19, 3, 462-491 (1997)
[18] E. Ruf, Optimizing sparse representations for dataflow analysis, ACM SIGPLAN Workshop on Intermediate Representations, January 1995, pp. 50-61. Proceedings published as ACM SIGPLAN Notices 30(3), March 1995.; E. Ruf, Optimizing sparse representations for dataflow analysis, ACM SIGPLAN Workshop on Intermediate Representations, January 1995, pp. 50-61. Proceedings published as ACM SIGPLAN Notices 30(3), March 1995.
[19] V.C. Sreedhar, Efficient program analysis using DJ graphs, Ph.D. Thesis, School of Computer Science, McGill University, Montréal, Québec, Canada, 1995.; V.C. Sreedhar, Efficient program analysis using DJ graphs, Ph.D. Thesis, School of Computer Science, McGill University, Montréal, Québec, Canada, 1995.
[20] V.C. Sreedhar, G.R. Gao, A linear time algorithm for placing \(φ\); V.C. Sreedhar, G.R. Gao, A linear time algorithm for placing \(φ\)
[21] B. Steensgaard, Sparse functional stores for imperative programs, ACM SIGPLAN Workshop on Intermediate Representations, January 1995, pp. 62-70. Proceedings published as ACM SIGPLAN Notices 30(3), March 1995.; B. Steensgaard, Sparse functional stores for imperative programs, ACM SIGPLAN Workshop on Intermediate Representations, January 1995, pp. 62-70. Proceedings published as ACM SIGPLAN Notices 30(3), March 1995.
[22] Ullman, J. D., Fast algorithms for the elimination of common subexpressions, Acta Inform., 2, 191-213 (1973) · Zbl 0287.68019
[23] W. Yang, S. Horwitz, T. Reps, Detecting program components with equivalent behaviors, Tech. Rep. Computer Science Tech. Report Number 840, University of Wisconsin, Madison, April 1989.; W. Yang, S. Horwitz, T. Reps, Detecting program components with equivalent behaviors, Tech. Rep. Computer Science Tech. Report Number 840, University of Wisconsin, Madison, April 1989.
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.