This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
A Control-Flow Normalization Algorithm and its Complexity
March 1992 (vol. 18 no. 3)
pp. 237-251

A single method for normalizing the control-flow of programs to facilitate program transformations, program analysis, and automatic parallelization is presented. While previous methods result in programs whose control flowgraphs are reducible, programs normalized by this technique satisfy a stronger condition than reducibility and are therefore simpler in their syntax and structure than with previous methods. In particular, all control-flow cycles are normalized into single-entry, single-exit while loops and all GOTOs are eliminated. Furthermore, the method avoids problems of code replication that are characteristic of node-splitting techniques. This restructuring obviates the control dependence graph, since afterwards control dependence relations are manifest in the syntax tree of the program. Transformations that effect this normalization are presented, and the complexity of the method is studied.

[1] A. V. Aho, J. E. Hopcroft, and J. D. Ullman,The Design and Analysis of Computer Algorithms. Reading, MA: Addison-Wesley, 1976.
[2] A. V. Aho and J. D. Ullman,The Theory of Parsing, Translation and Computing, Vol. II: Computing. Englewood Cliffs, NJ: Prentice-Hall, 1973.
[3] F. Allen, M. Burke, P. Charles, R. Cytron, and J. Ferrante, "An overview of the ptran analysis system for multiprocessing," IBM, Tech. Rep. RC 13115 (#56866), 1987.
[4] F. E. Allen and J. Cocke, "A program data flow analysis procedure,"CACM, vol. 19, no. 3, Mar. 1977.
[5] J. R. Allen, K. Kennedy, C. Porterfield, and J. Warren, "Conversion of control dependence to data dependence,"POPL, Jan. 1983.
[6] Z. Ammarguellat, "Restructuration des programmes fortran en vue de leur parallelisation," Ph.D. thesis, Lab, MASI, Univ. de Pierre et Marie-Curie, Paris 6, France, 1988.
[7] Z. Ammarguellat, "Normalization of program control flow," Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep. CSRD 885, May 1989.
[8] Z. Ammarguellat, "A control-flow normalization algorithm and its complexity," Ctr. Supercomput, Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep., 1990.
[9] Z. Ammarguellat and W.L. Harrison III, "Automatic recognition of induction variables and recurrence relations by abstract interpretation-corrected version," inProc. SIGPLAN '90 Conf. Program. Languages Design and Implementation, 1990.
[10] E. Ashcroft and Z. Manna, "The translation of (goto) programs to (while) programs," inProc. IFIP Cong. '71(Amsterdam), 1972.
[11] E. Ashcroft and Z. Manna, "Translating program schemas to while-schemas,"SIAM J. Comput., vol. 4, no. 2, 1975.
[12] B. Baker, "An algorithm for structuring flowgraphs,"JACM, vol. 24, no. 1, 1977.
[13] C. Bohm and G. Jacopini, "Flow diagrams and languages with only two formation rules,"CACM, vol. 9, no. 5, pp. 366-371, May 1966.
[14] R. A. Brooks, R. P. Gabriel, and G. L. Steele, Jr., "An optimizing compiler for lexically scoped lisp,"ACM SIGPLAN Notices, vol. 17, no. 6, June 1982.
[15] B. A. Carre, "An algebra for network routing problems,"J. Instit. Math. Appl., vol. 7, 1971.
[16] J. Chailloux,Le-Lisp Version 15. Rocquencourt, France: INRIA, Feb. 1985.
[17] J. Davies, C. Huson, T. Macke, B. Leasure, and M. Wolfe, "The kaps-1: an advanced source-to-source vectorizer for the s-1 mark iia supercomputer," inProc. 1986 Int. Conf. Parallel Process., 1986.
[18] R. Floyd, "Shortest path,"CACM, vol. 5, no. 6, 1962.
[19] S. Graham and M. Wegman, "Fast and usually linear algorithm for global flow analysis,"JACM, vol. 23, no. 1, Jan. 1976.
[20] M. Hecht,Flow Analysis of Computer Programs. New York: Elsevier North-Holland, 1977.
[21] W. L. Harrison III, "Compiling lisp for evaluation on a tightly coupled multiprocessor," Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep., 1986.
[22] W. L. Harrison III, "The interprocedural analysis and automatic parallelization of scheme programs,"Lisp and Symbolic Computation: an Int. J., vol. 2, no. 3, 1989.
[23] W. L. Harrison III, "Pointers, procedures and parallelization," Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep., 1991.
[24] W. L. Harrison III and Z. Ammarguellat, "The design of parallelizers for symbolic and numeric programs," inProc. 2nd U.S.-Japan Workshop on Parallel Lisp, T. Ito and R. Halstead, Eds., June 1989.
[25] W. L. Harrison III and Z. Ammarguellat, "Miprac: a compiler for symbolic and numerical programs," Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep., 1990.
[26] D. B. Johnson, "Efficient algorithms for shortest paths in sparse networks,"JACM, vol. 24, no. 1, 1977.
[27] D. E. Knuth, "Structured programming with GOTO statements,"Comput. Surveys, vol. 6, pp. 261-301, Dec. 1974.
[28] D. E. Knuth and R. W. Floyd, "Notes on avoiding go to statements,"Inform. Process. Lett., vol. 1, 1971.
[29] D. J. Kuck, R. H. Kuhn, B. Leasure, and M. J. Wolfe, "The structure of an advanced vectorized for pipelined processors," inProc. 4th Int. Comput. Software and Appl. Conf., 1980.
[30] A. Mazurkiewicz, "Proving algorithms by tail functions,"Inform. Contr., vol. 18, 1970.
[31] P. D. Mosses, "The mathematical semantics of algol 60," Program Res. Group, Oxford Univ., Oxford, UK, Tech. Mono. P.R. G 12, Jan. 1974.
[32] D. A. Padua and M. J. Wolfe, "Advanced compiler optimizations for supercomputers,"Common. ACM, vol. 29, no. 12, pp. 1184- 1201, Dec. 1986.
[33] W. W. Peterson, T. Kasami, and N. Tokura, "On the capabilities of while, repeat and exit statements,"CACM, vol. 16, no. 8, 1973.
[34] L. Pointer, "Perfect club report," Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, Tech. Rep. 896, July 1989.
[35] Proc. IFIP Cong. '71: A Basis for Program Optimization. Amsterdam: North-Holland, 1971.
[36] E. M. Reingold, J. Nievergelt, and N. Deo,Combinatorial Algorithms--Theory and Practice. Englewood Cliffs, NJ: Prentice-Hall, 1977.
[37] B. G. Ryder, "Incremental data flow analysis based on a unified model of elimination algorithms," inConf. Rec. 9th Ann. ACM Symp. POPL, 1982, pp. 167-176.
[38] B. G. Ryder and M. C. Paull, "Elimination algorithms for data flow analysis,"ACM Comput. Surveys, vol. 18, no. 3, Sept. 1986.
[39] R. W. Scheifler, "A denotational semantics of CLU," HITLCS, Tech. Rep. No. 201, May 1978.
[40] D. A. Schmidt,Denotational Semantics. Newton, MA: Allyn and Bacon, 1986.
[41] C. Shannon and J. McCarthy, "Representation of events in nerve nets and finite automata,"Automata Studies, 1956.
[42] J. E. Stoy,Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. Cambridge, MA: MIT Press, 1977.
[43] R. E. Tarjan, "Fast algorithms for solving path problems,"JACM, vol. 28, no. 3, July 1981.
[44] N. Tawbi, A. Dumay, and P. Feautrier, "Paf: un paralleliseur automatique pour fortran," Lab. MASI, Univ. de Pierre et Marie-Curie, Paris 6, France, Tech. Rep. 185, May 1988.
[45] R. D. Tennent, "The denotational semantics of programming languages,"CACM, vol. 19, no. 8, 1976.
[46] J. D. Ullman, "Fast algorithms for the elimination of common subexpressions,"Acta Inform., vol. 2, no. 3, 1973.
[47] M. H. Williams and H. L. Ossher, "Conversion of unstructured flow diagrams to structured,"Comput. J., vol. 21, no. 2, 1975.
[48] M. J. Wolfe, "Optimizing supercompilers for supercomputers," Ph.D. thesis, Ctr. Supercomput. Res. and Development, Univ. Illinois, Urbana-Champaign, 1980.

Index Terms:
control-flow normalization algorithm; complexity; automatic parallelization; control flowgraphs; control-flow cycles; GOTOs; node-splitting techniques; control dependence relations; syntax tree; computational complexity; graph theory; parallel algorithms; structured programming
Citation:
Z. Ammarguellat, "A Control-Flow Normalization Algorithm and its Complexity," IEEE Transactions on Software Engineering, vol. 18, no. 3, pp. 237-251, March 1992, doi:10.1109/32.126773
Usage of this product signifies your acceptance of the Terms of Use.