## Control Flow Analysis: A Compilation Paradigm for Functional Language (1995)

Venue: | In Proceedings of SAC 95 |

Citations: | 1 - 0 self |

### BibTeX

@INPROCEEDINGS{Serrano95controlflow,

author = {Manuel Serrano},

title = {Control Flow Analysis: A Compilation Paradigm for Functional Language},

booktitle = {In Proceedings of SAC 95},

year = {1995}

}

### OpenURL

### Abstract

Control flow analysis (cfa) is now well known but is not widely used in real compilers since optimizations that can be achieved via cfa are not so clear. This paper aims at showing that control flow analysis is very valuable in practice by presenting a fundamental optimization based on cfa: the closure representation algorithm, the essential optimizing phase of a -language compiler. Since naive and regular scheme to represent functions as heap allocated structures is far too inefficient, the main effort of modern functional languages compilers is devoted to minimize the amount of memory allocated for functions. In particular, compilers try to discover when a procedure can safely be handled without any allocation at all. Previously described methods to do so are ad hoc, depending on the language compiled, and not very precise. Using cfa, we present a general approach which produces better results. This refined closure analysis subsumes previously known ones and optimizes more than 80 % ...

### Citations

316 | Control-Flow Analysis of Higher-Order Languages
- Shivers
- 1991
(Show Context)
Citation Context ...c parts of the control can be revealed by control flow analysis. The analysis we have made in Bigloo is close to the "0cfa" (0th-order Control Flow Analysis) described by O. Shivers in his P=-=hD thesis [14]-=-. First, for each functional call in a program it statically computes an approximation of the set of functions that can be invoked in any execution. The approximations are sometimes too rough (for exa... |

208 | Control flow analysis in Scheme
- Shivers
- 1988
(Show Context)
Citation Context ...nd of works are related to ours. First of them, the studies of control flow. ffl Olin Shivers has published numerous papers on control flow analysis in modern functional languages such as Scheme or ML=-=[13, 15]-=-. His aim was to study the analysis as well as its applications : the first half of his PhD thesis is devoted to the analysis semantics and the second to application examples. He has defined a general... |

201 | Soft Typing
- Cartwright, Fagan
(Show Context)
Citation Context ...ur analysis do: the author claims to remove from 60 to 95 % of the tests. His analysis is entirely devoted to type checking, not to closure allocation improvement. ffl Cartwright, Wright and Fagan in =-=[2, 21]-=- and Thatte in [19] show systems performing partial static type 4 Kranz is a bit more precise since closures requiring environment allocation are themself divided into two parts, the ones which are he... |

198 | Orbit: An Optimizing Compiler for Scheme
- Kranz
- 1988
(Show Context)
Citation Context ...cs and the second to application examples. He has defined a general analysis of which the 0cfa is a special case. He has also used a more precise analysis called the "1cfa", which was protot=-=yped in T [7]-=-, a Scheme compiler. Shivers has briefly given time figures for the 1cfa analysis but no precise measures of its costs and benefits. Therefore no conclusions can be drawn on its relevance in real situ... |

113 | A Practical Soft Type System for Scheme
- Wright, Cartwright
- 1997
(Show Context)
Citation Context ...ur analysis do: the author claims to remove from 60 to 95 % of the tests. His analysis is entirely devoted to type checking, not to closure allocation improvement. ffl Cartwright, Wright and Fagan in =-=[2, 21]-=- and Thatte in [19] show systems performing partial static type 4 Kranz is a bit more precise since closures requiring environment allocation are themself divided into two parts, the ones which are he... |

64 | SCHEME->C a portable scheme-to-c compiler
- Bartlett
- 1989
(Show Context)
Citation Context ...ditional Gabriel benchmarks do not fit our needs since they are rather small and they are not higher order), we shortly give the time figures for another Scheme to C compiler. We chose Bartlett's one =-=[1]. The meas-=-ures have been obtained with the March 15th, 1993 release. All compilations have been processed with the flags: "-On-Ob-Og-Ot-cc gcc -O". This means that the compilation is unsafe and that f... |

57 | The semantics of Scheme control-flow analysis
- Shivers
- 1991
(Show Context)
Citation Context ...nd of works are related to ours. First of them, the studies of control flow. ffl Olin Shivers has published numerous papers on control flow analysis in modern functional languages such as Scheme or ML=-=[13, 15]-=-. His aim was to study the analysis as well as its applications : the first half of his PhD thesis is devoted to the analysis semantics and the second to application examples. He has defined a general... |

54 |
Quasi-Static Typing
- Thatte
- 1990
(Show Context)
Citation Context ...thor claims to remove from 60 to 95 % of the tests. His analysis is entirely devoted to type checking, not to closure allocation improvement. ffl Cartwright, Wright and Fagan in [2, 21] and Thatte in =-=[19]-=- show systems performing partial static type 4 Kranz is a bit more precise since closures requiring environment allocation are themself divided into two parts, the ones which are heap allocated and th... |

52 | Global tagging optimization by type inference
- Henglein
- 1992
(Show Context)
Citation Context ... between W and 0cfa is that both of them have high complexities but, in practice, they behave as if they were linear ! ffl Fritz Henglein presents an optimization which allows to remove useless tests =-=[5]-=-. He does not use control analysis but seems to eliminate more tests than our analysis do: the author claims to remove from 60 to 95 % of the tests. His analysis is entirely devoted to type checking, ... |

47 |
Using and porting the GNU CC
- Stallman
- 1989
(Show Context)
Citation Context ...on modes so far described, we have evaluated the number of type checks done, and the number of closures allocations. We have also measured the compilation time with and without the C compiler (GNU-cc =-=[16]-=- always used with the -O compiler option). For each time figure, ffi is the ratio 1 \Gamma O2=O. Time figures (expressed in seconds) present the average of several consecutive executions run on a Sun ... |

37 |
1178-1990. IEEE Standard for the Scheme Programming Language
- Std
- 1991
(Show Context)
Citation Context ...al basis and subsumes previously known ones. This analysis optimizes more than 80 % of closures on the average. The first optimization concerns compilers of dynamically typed languages such as Scheme =-=[17]-=-; the second one is of more general interest: it applies to every -language compiler, including those statically type checked (such as ML [4, 20]). The optimization described in this paper are fully i... |

13 |
The CAML reference manual, version 2.6.1
- Weis
- 1990
(Show Context)
Citation Context ...s compilers of dynamically typed languages such as Scheme [17]; the second one is of more general interest: it applies to every -language compiler, including those statically type checked (such as ML =-=[4, 20]-=-). The optimization described in this paper are fully integrated into a real Scheme compiler (Bigloo). We can therefore report reliable measures of their effectiveness. Our figures show that reduction... |

8 | Compilation of Non-Linear, Second Order Patterns on S-Expressions
- Queinnec
- 1990
(Show Context)
Citation Context ...k v s))) ... Figure 12: program author size iterations description Queens L. Auguston 97 3 Number of solutions of the queens problem. Semantics C. Queinnec 231 5 A pattern matching language semantics =-=[9]-=-. Pp M. Feeley 524 4 A Scheme pretty printer. Conform 569 5 A program making heavy use of higher-order procedures. Peval M. Feeley 632 3 A simple partial evaluator. Earley M. Feeley 661 5 An earley pa... |

8 |
Taming the Y operator
- Rozas
- 1992
(Show Context)
Citation Context ...ortant since like fib and fibo, many functions satisfy the S predicate. The measures of section 4 will prove this. 3.3.2 X : Fix point operator The example of Figure 8 is taken from G.J. Rozas' paper =-=[11]-=-. It has been rewritten only by replacing the lambda forms by labels forms. One of the consequences of this transformation is that the procedures are named. 01: (let ((fac (labels ((y (f) 02: (labels ... |

7 |
Lambda Lifting: Transforming Programs into Recursive
- Johnson
- 1985
(Show Context)
Citation Context ...deed, if a function f satisfies the X predicate then 8s = [[(funcall g : : :)]] 2 USE(f); A(g) = ffg This means that only f can be invoked. The computed call can be replaced (using a "lambda lift=-=ing" [6]-=- pass if needed) by a direct call which does not require any allocation. 2 Proposition 4 For each f in FunId, if f satisfies the T predicate then f can be allocated in an more efficient way (i.e. with... |

6 |
Th'eorie et pratique de Sqil, un langage interm'ediaire pour la compilation des langages fonctionnels. Th`ese de doctorat d'universit'e, Universit'e Pierre et Marie Curie (Paris 6
- S'eniak
- 1991
(Show Context)
Citation Context ...ng function and labels. Therefore, what is usually written in Scheme : (lambda (: : :) : : :) must be written in our language : (labels ((id (: : :) : : :)) (function id)) The influence of N. S'eniak =-=[12]-=- compilation methodology (where dynamic parts of the control are isolated) has led to the removal of lambda form. Functions, when used as values, are always processed by the function special form; thi... |

4 |
Principle Type Inference for Functional Programs (extended abstract
- Damas, Milner
- 1982
(Show Context)
Citation Context ...d with 0cfa analysis are at least as good as theirs. People worked on reducing type checking in dynamic typed language : ffl Our type investigation differs from of the W algorithm of Damas and Milner =-=[3]-=-. Our goal is to compute only approximation of types rather than perform a total type computation. In particular a variable can be of several types. The W algorithm types functions without knowing whe... |

3 |
The Definition of Standard ML, MIT-Press
- Milner, Tofte, et al.
- 1990
(Show Context)
Citation Context ...s compilers of dynamically typed languages such as Scheme [17]; the second one is of more general interest: it applies to every -language compiler, including those statically type checked (such as ML =-=[4, 20]-=-). The optimization described in this paper are fully integrated into a real Scheme compiler (Bigloo). We can therefore report reliable measures of their effectiveness. Our figures show that reduction... |

1 |
an Algol like compiler for Scheme
- Liar
- 1984
(Show Context)
Citation Context ... as the elimination of useless environments, or the errors that can be introduced by the results of a control analysis. Unfortunately, although the optimizations have been implemented in his compiler =-=[10]-=-, he gave no measures allowing to have an idea of their impact. Previous closure analyses have to be compared to the one presented in this article. D. Kranz's PhD thesis [8] and N. S'eniak's one [12] ... |