## A Control-Flow Normalization Algorithm and Its Complexity (1992)

### Cached

### Download Links

- [polaris.cs.uiuc.edu]
- [www.csrd.uiuc.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | IEEE Transactions on Software Engineering |

Citations: | 43 - 0 self |

### BibTeX

@ARTICLE{Ammarguellat92acontrol-flow,

author = {Zahira Ammarguellat},

title = {A Control-Flow Normalization Algorithm and Its Complexity},

journal = {IEEE Transactions on Software Engineering},

year = {1992},

volume = {18},

pages = {237--251}

}

### Years of Citing Articles

### OpenURL

### Abstract

We present a simple method for normalizing the control-flow of programs to facilitate program transformations, program analysis, and automatic parallelization. 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 goto's 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. In this paper we present transformations that effect this normalization, and study the complexity of the method. Index Terms: Continuations, control-flow, elimination algorithms, normalization,...

### Citations

2438 |
The Design and Analysis of Computer Algorithms
- Aho, Hopcroft, et al.
- 1974
(Show Context)
Citation Context ...d consists of applying the transformations T 1 and T 2 , as described in the paper earlier, to these regions. The search for common factors in the reduced equations allows a saving in the calculation =-=[1, 37, 46]-=-. This improvement provides a complexity of O(n log n) rather than a O(n 2 ) Allen and Cocke's complexity. 7.3 Tarjan Method The Tarjan method uses a different notion of intervals from the above metho... |

441 |
Optimizing Supercompilers for Supercomputers
- Wolfe
- 1989
(Show Context)
Citation Context ...n by normalization. The second purpose is vectorization. In order to vectorize statements that are conditionally executed in a loop, one must attach boolean variables (mode vectors) to the statements =-=[29, 48, 17, 32]-=-. By control-flow normalization we may accomplish this easily for any program. MIPRAC is a multilingual compiler for shared memory machines being implemented at the University of Illinois. Its applica... |

302 |
Advanced Compiler Optimizations for Supercomputers
- Padua, Wolfe
- 1986
(Show Context)
Citation Context ...n by normalization. The second purpose is vectorization. In order to vectorize statements that are conditionally executed in a loop, one must attach boolean variables (mode vectors) to the statements =-=[29, 48, 17, 32]-=-. By control-flow normalization we may accomplish this easily for any program. MIPRAC is a multilingual compiler for shared memory machines being implemented at the University of Illinois. Its applica... |

277 |
Flow Analysis of Computer Programs
- Hecht
- 1977
(Show Context)
Citation Context ...have run an experiment that normalizes the scientific computations of the Perfect Club [34]. See figures 24 and 25 in section 5. 2.5.4 Derecursivation Derecursivation, like T 1 Hecht's transformation =-=[20]-=-, consists of making a loop explicit. A self-recursive equation has this form: x i = (begin Cmd (if Exp (begin Cmd 1 x i ) (begin Cmd 2 x j ))) Intuitively this equation is a loop whose entry is the i... |

262 |
Conversion of control dependence to data dependence
- Allen, Kennedy, et al.
- 1983
(Show Context)
Citation Context ...wish the compiler to work always with a normalized program, we may apply normalization following such transformations. A lot of work has been done in the normalization of the control-flow of programs =-=[10, 47, 12, 5]-=-. All of these techniques result in programs with reducible (defun f (lambda (x y) (begin (cond ((null? x) y) ((atom? x) y) (t (f (cdr x) (f (car x) y))))))) Figure 1: A sample of recursive Lisp progr... |

203 |
The Theory of Parsing
- Aho, Ullman
- 1972
(Show Context)
Citation Context ... In accordance with the resolution order we have chosen, the predecessors of i will be treated before i itself. When we come to substitute i, it will appear in the equation of its nearest dominator h =-=[2]-=-. After factorization of h, i will appear only once in h, and will be substituted for only once. Case 2: i is in a loop whose header is h but i and h are distinct. In this case, by the order we have c... |

171 |
Semantics of Programming Languages
- Tennent
- 1991
(Show Context)
Citation Context ...nd represents the normalized form of the program. 2.1 Denotational Semantics The semantics of a programming language is a precise mathematical specification of the meaning of programs in the language =-=[42, 45, 40]-=-. The idea of this approach is to define functions which map syntactic constructs into algebraic ones. This method is based on Scott and Strachey's work and has been used to define languages like ALGO... |

126 | Flow Diagrams, Turing Machines and Languages with Only Two Formation Rules
- Bohm, Jacopini
- 1966
(Show Context)
Citation Context ...uctions that the program contains. Williams and Ossher [47] have proved that such an elimination is necessary and sufficient to obtain a structured form of the program. A theorem of Bohm and Jacopini =-=[13]-=- says that we may transform any program into another one where only the following three control structures are used: ffl Assignment ffl Conditional ffl Iteration However, their theorem is not construc... |

100 |
A program data flow analysis procedure
- Allen, Cocke
- 1976
(Show Context)
Citation Context ...usted to handle them. The equations it uses are quite different from ours. They represent the dataflow equations of the program. They describe the reaching definitions of each variable of the program =-=[4, 38]-=-. The Allen and Cocke algorithm consists of the iteration of three phases: a partitioning algorithm that finds single entry regions in the dependency graph, elimination of the dataflow equations, and ... |

99 |
An overview of the PTRAN analysis system for multiprocessing
- Allen, Burke, et al.
- 1988
(Show Context)
Citation Context ...ct interpretation or dataflow analysis. Third, our technique obviates the control dependence graph. Much effort is spent in traditional parallelizing compilers in the treatment of control dependencess=-=[3]-=-. We will argue that when the control-flow of a program is properly normalized, control dependence relations are so manifest in the syntax tree of the normalized program that there is no need for a se... |

91 |
The interprocedural analysis and automatic parallelization of Scheme programs
- Harrison
- 1989
(Show Context)
Citation Context ...duce unstructured code when it applies classical program transformations such as tail recursion elimination [14]. For an example see figures 1 and 2. Other transformations such as recursion splitting =-=[22]-=- result in even more complex output than the tail recursion elimination. If we wish the compiler to work always with a normalized program, we may apply normalization following such transformations. A ... |

90 |
Fast algorithms for solving path problems
- Tarjan
- 1981
(Show Context)
Citation Context ...thod is applied to reducible flowgraphs. For such a graph the algorithm requires a time of O(nff(n)) where ff is the inverse of Ackerman's function. A simpler algorithm that runs in O(n log n) exists =-=[43]-=-. 7.4 Graham and Wegman Method This algorithm is close to Tarjan's interval analysis; but it handles irreducible graphs without the need for eliminating the irreducibility. The notion of intervals is ... |

75 |
A fast and usually linear algorithm for global flow analysis
- Graham, Wegman
- 1976
(Show Context)
Citation Context ...on of the Gaussian Eliminationlike Method There are several problems closely related to control-flow normalization that make use of Gaussian elimination resolution. These include global flow analysis =-=[19, 20]-=-, shortest path problems [15, 18, 26] and conversion of finite automata to regular expressions [41]. The fundamental framework of these problems is to build a system of equations based on regions of a... |

53 | Elimination algorithms for data flow analysis
- Ryder, Paull
- 1986
(Show Context)
Citation Context ...sis, because after normalization the internal structure of a program is obvious and trivial. It may therefore be used to simplify the implementation of dataflow analysis since pathological flowgraphs =-=[38]-=- will not exist. Unnormalized programs may arise in several ways. First, unstructured programs can be written in languages such as Common Lisp, Fortran, Pascal or C. Second, the compiler itself may pr... |

47 |
An algorithm for structuring flowgraphs
- Baker
- 1977
(Show Context)
Citation Context ...wish the compiler to work always with a normalized program, we may apply normalization following such transformations. A lot of work has been done in the normalization of the control-flow of programs =-=[10, 47, 12, 5]-=-. All of these techniques result in programs with reducible (defun f (lambda (x y) (begin (cond ((null? x) y) ((atom? x) y) (t (f (cdr x) (f (car x) y))))))) Figure 1: A sample of recursive Lisp progr... |

40 |
Structured Programming with goto Statements
- Knuth
- 1974
(Show Context)
Citation Context ... levels of iteration. Each of them may be appropriate for some cases; however the programs they produce are often less regular than those produced by our method and often contain more replicated code =-=[27]-=-. None presents a simple comprehensive algorithm for the normalization of all control flowgraphs. We present, below, a limited overview of each of these methods; however, we emphasize Kennedy's method... |

35 |
1971] An algebra for network routing problems
- Carre
(Show Context)
Citation Context ...e Method There are several problems closely related to control-flow normalization that make use of Gaussian elimination resolution. These include global flow analysis [19, 20], shortest path problems =-=[15, 18, 26]-=- and conversion of finite automata to regular expressions [41]. The fundamental framework of these problems is to build a system of equations based on regions of a flowgraph and to solve this system u... |

34 |
Automatic recognition of induction variables and recurrence relations by abstract interpretation
- Ammerguallat, Harrison
- 1990
(Show Context)
Citation Context ...e). In PAF the normalization method has two applications. The first is to convert every cycle (explicit or implicit) into while loops, which are themselves transformed into do loops whenever possible =-=[9]-=-, and finally into doall loops when the dependences permit it. In other words, even when a programmer writes loops using goto's, or writes unstructured do loops, they are made eligible for paralleliza... |

33 |
The structure of an advanced vectorizer for pipelined processors
- Kuck, Kuhn, et al.
- 1980
(Show Context)
Citation Context ...n by normalization. The second purpose is vectorization. In order to vectorize statements that are conditionally executed in a loop, one must attach boolean variables (mode vectors) to the statements =-=[29, 48, 17, 32]-=-. By control-flow normalization we may accomplish this easily for any program. MIPRAC is a multilingual compiler for shared memory machines being implemented at the University of Illinois. Its applica... |

21 |
On the Capabilities of While, Repeat, and Exit Statements
- Peterson, Kasami, et al.
- 1973
(Show Context)
Citation Context ...at the boolean expressions generated by the normalization are small enough that simplification would not be a major expense. 6 Position of Our Work Several techniques exist for structuring flowgraphs =-=[13, 28, 33, 11, 12, 5]-=-. Most of these techniques consist of modifications such eliminating goto statements, adding control-flow variables, copying code, creating and calling procedures and adding levels of iteration. Each ... |

18 |
Fast algorithms for the elimination of common subexpressions
- ULLMAN
- 1973
(Show Context)
Citation Context ...d consists of applying the transformations T 1 and T 2 , as described in the paper earlier, to these regions. The search for common factors in the reduced equations allows a saving in the calculation =-=[1, 37, 46]-=-. This improvement provides a complexity of O(n log n) rather than a O(n 2 ) Allen and Cocke's complexity. 7.3 Tarjan Method The Tarjan method uses a different notion of intervals from the above metho... |

15 |
Z.: Transforming ’goto’ programs into ’while’ programs
- Ashcroft, Manna
- 1971
(Show Context)
Citation Context ...wish the compiler to work always with a normalized program, we may apply normalization following such transformations. A lot of work has been done in the normalization of the control-flow of programs =-=[10, 47, 12, 5]-=-. All of these techniques result in programs with reducible (defun f (lambda (x y) (begin (cond ((null? x) y) ((atom? x) y) (t (f (cdr x) (f (car x) y))))))) Figure 1: A sample of recursive Lisp progr... |

15 |
Proving algorithms by tail functions
- Mazurkiewicz
- 1971
(Show Context)
Citation Context ...ect semantics to a semantics with continuations. The theory of continuations was developed by C. Wadsworth and L. Morris independently. This notion originated from the "tail function" of Maz=-=urkiewicz [30]-=-. 2.1.1 Continuations Continuations are a powerful tool because they allow us to give a straightforward meaning to branches, exceptions and errors, and because they allow us to regain a degree of the ... |

15 |
Denotational Semantics. Allyn and
- Schmidt
- 1986
(Show Context)
Citation Context ...nd represents the normalized form of the program. 2.1 Denotational Semantics The semantics of a programming language is a precise mathematical specification of the meaning of programs in the language =-=[42, 45, 40]-=-. The idea of this approach is to define functions which map syntactic constructs into algebraic ones. This method is based on Scott and Strachey's work and has been used to define languages like ALGO... |

13 | An optimizing compiler for lexically scoped LISP
- Brooks, Gabriel, et al.
- 1982
(Show Context)
Citation Context ... in languages such as Common Lisp, Fortran, Pascal or C. Second, the compiler itself may produce unstructured code when it applies classical program transformations such as tail recursion elimination =-=[14]-=-. For an example see figures 1 and 2. Other transformations such as recursion splitting [22] result in even more complex output than the tail recursion elimination. If we wish the compiler to work alw... |

13 |
Conversion of Unstructured Flow Diagrams to Structured Form
- Williams, Ossher
- 1978
(Show Context)
Citation Context |

11 |
Compiling Lisp for Evaluation on a Tightly Coupled Multiprocessor
- Harrison
- 1986
(Show Context)
Citation Context ...eed to be concerned with branches into the middle of, and out from the middle of the expression: control flows into and out of the expression in an orderly way. The reader may look at Harrison's work =-=[21]-=- to see the difficulties that we may encounter for program transformations such as exit-loop parallelization and recursion splitting [22], when they are performed on a code that is not so structured. ... |

11 |
Notes on avoiding “go to” statements
- Knuth, Floyd
- 1971
(Show Context)
Citation Context ...at the boolean expressions generated by the normalization are small enough that simplification would not be a major expense. 6 Position of Our Work Several techniques exist for structuring flowgraphs =-=[13, 28, 33, 11, 12, 5]-=-. Most of these techniques consist of modifications such eliminating goto statements, adding control-flow variables, copying code, creating and calling procedures and adding levels of iteration. Each ... |

8 |
Translating program schemas to while-schemas
- Ashcroft, Manna
- 1975
(Show Context)
Citation Context ...at the boolean expressions generated by the normalization are small enough that simplification would not be a major expense. 6 Position of Our Work Several techniques exist for structuring flowgraphs =-=[13, 28, 33, 11, 12, 5]-=-. Most of these techniques consist of modifications such eliminating goto statements, adding control-flow variables, copying code, creating and calling procedures and adding levels of iteration. Each ... |

8 |
Shortest path
- Floyd
- 1962
(Show Context)
Citation Context ...e Method There are several problems closely related to control-flow normalization that make use of Gaussian elimination resolution. These include global flow analysis [19, 20], shortest path problems =-=[15, 18, 26]-=- and conversion of finite automata to regular expressions [41]. The fundamental framework of these problems is to build a system of equations based on regions of a flowgraph and to solve this system u... |

7 |
The mathematical semantics of Algol 60
- Mosses
- 1974
(Show Context)
Citation Context ... idea of this approach is to define functions which map syntactic constructs into algebraic ones. This method is based on Scott and Strachey's work and has been used to define languages like ALGOL 60 =-=[31]-=-, PASCAL [45], and CLU [39]. Our input language contains branching instructions. Simple jumps make the semantics of programs more complex because we lose the compositionality of the semantics of comma... |

5 |
A denotational semantics of CLU
- Scheifler
- 1978
(Show Context)
Citation Context ...o define functions which map syntactic constructs into algebraic ones. This method is based on Scott and Strachey's work and has been used to define languages like ALGOL 60 [31], PASCAL [45], and CLU =-=[39]-=-. Our input language contains branching instructions. Simple jumps make the semantics of programs more complex because we lose the compositionality of the semantics of commands. We must then switch fr... |

4 |
Perfect Club Report
- Pointer
- 1989
(Show Context)
Citation Context ...mply a test for the value of the selector. To compare these two methods and to measure their respective cost, we have run an experiment that normalizes the scientific computations of the Perfect Club =-=[34]-=-. See figures 24 and 25 in section 5. 2.5.4 Derecursivation Derecursivation, like T 1 Hecht's transformation [20], consists of making a loop explicit. A self-recursive equation has this form: x i = (b... |

3 |
Restructuration des programmes FORTRAN en vue de leur parall'elisation
- Ammarguellat
- 1988
(Show Context)
Citation Context ...et; in particular, all control-flow cycles are normalized into singleentry, single-exit while loops. Such loops may be further transformed into conventional do loops by induction variable recognition =-=[6, 9]-=-. This makes our method particularly helpful in automatic parallelization, where highly regular loop structures are essential [32], [22]. It simplifies both forward and backward dataflow analyses by t... |

3 |
Normalization of Program Control Flow
- Ammarguellat
- 1989
(Show Context)
Citation Context ...gram. In our approach a point will represent a program label. The author provides, for the interested reader, a denotational semantics with continuations for the primitive expressions of our language =-=[7, 8]-=-. The language is described in the following section. 2.2 Abstract Syntax Cste 2 Cste Constants Ide 2 Ide Identifiers (variables) Cmd 2 Cmd Commands or expressions lambda 2 Proc Lambda expressions Cmd... |

3 |
The KAP/S-1: An Advanced Source-to-Source Vectorizer for the S-1 Mark IIa Supercomputer
- Davies, Huson, et al.
- 1986
(Show Context)
Citation Context |

3 |
PAF: un Paralleliseur Automatique pour FORTRAN," Rapport Interne de
- Tawbi, Dumay, et al.
- 1987
(Show Context)
Citation Context ...ng boolean conditions. 5 Application of the Normalization Process The normalization method that we have presented has been put to several uses in projects with which the author has been involved: PAF =-=[44]-=- and MIPRAC [24]. PAF is an experimental Fortran parallelizer developed at the University of Paris 6 (France). In PAF the normalization method has two applications. The first is to convert every cycle... |

2 |
procedures and parallelization
- Pointers
- 1991
(Show Context)
Citation Context ... more efficient. The reader may contrast the interprocedural analysis, where continuations are used [22], to that where direct semantics are applied to programs whose procedures bodies are normalized =-=[23]-=-. The third application is to simplify program transformations. When restructuring an expression, we do not need to be concerned with branches into the middle of, and out from the middle of the expres... |

2 |
The design of parallelizers for symbolic and numeric programs
- Harrison, Ammarguellat
- 1989
(Show Context)
Citation Context ...or such as +,-,*,/,and, or, : : : . For the purpose of simplicity, the grammar includes only scalar variables. The normalization method we are presenting has been applied to Fortran and Lisp programs =-=[6, 24]-=-, and is by no means restricted to the treatment of scalar data; nor does it require restrictions upon side effects and aliasing. 2.3 Continuation Equations For a procedure P we may give a syntactic r... |

2 |
Denotational Semantics: The Schott-Strachey Approach to Programming Language Theory
- Stoy
- 1977
(Show Context)
Citation Context ...nd represents the normalized form of the program. 2.1 Denotational Semantics The semantics of a programming language is a precise mathematical specification of the meaning of programs in the language =-=[42, 45, 40]-=-. The idea of this approach is to define functions which map syntactic constructs into algebraic ones. This method is based on Scott and Strachey's work and has been used to define languages like ALGO... |

1 |
Le-Lisp Version 15
- Chailloux
(Show Context)
Citation Context ...s are used. The input language we treat has a Lisp-like syntax and includes branching instructions (goto's) and labels at the top-level of procedures. We applied this method to Fortran 77 and Le-Lisp =-=[16]-=- [6], and are applying it to Common Lisp, and C [25]. The output language contains single-entry, single-exit while loops but neithersgoto's nor labels, and represents the normalized form of the progra... |

1 |
Miprac: A compiler for symbolic and numerical programs
- Harrison, Ammarguellat
- 1990
(Show Context)
Citation Context ...ike syntax and includes branching instructions (goto's) and labels at the top-level of procedures. We applied this method to Fortran 77 and Le-Lisp [16] [6], and are applying it to Common Lisp, and C =-=[25]-=-. The output language contains single-entry, single-exit while loops but neithersgoto's nor labels, and represents the normalized form of the program. 2.1 Denotational Semantics The semantics of a pro... |

1 |
Efficient algorithms for shortest paths in sparse networks
- Jonhson
- 1977
(Show Context)
Citation Context ...e Method There are several problems closely related to control-flow normalization that make use of Gaussian elimination resolution. These include global flow analysis [19, 20], shortest path problems =-=[15, 18, 26]-=- and conversion of finite automata to regular expressions [41]. The fundamental framework of these problems is to build a system of equations based on regions of a flowgraph and to solve this system u... |

1 |
Incremental data flow analysis based on a unified model of elimination algorithms
- Ryder
- 1982
(Show Context)
Citation Context ...d consists of applying the transformations T 1 and T 2 , as described in the paper earlier, to these regions. The search for common factors in the reduced equations allows a saving in the calculation =-=[1, 37, 46]-=-. This improvement provides a complexity of O(n log n) rather than a O(n 2 ) Allen and Cocke's complexity. 7.3 Tarjan Method The Tarjan method uses a different notion of intervals from the above metho... |

1 |
and J.McCarthy. Representation of events in nerve nets and finite automata. Automata Studies
- Shannon
- 1956
(Show Context)
Citation Context ...rmalization that make use of Gaussian elimination resolution. These include global flow analysis [19, 20], shortest path problems [15, 18, 26] and conversion of finite automata to regular expressions =-=[41]-=-. The fundamental framework of these problems is to build a system of equations based on regions of a flowgraph and to solve this system using the Gaussian resolution. In the following we give an over... |