added new licence header
[libfirm] / ir / opt / escape_ana.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /*
21  * Project:     libFIRM
22  * File name:   ir/opt/escape_ana.h
23  * Purpose:     escape analysis and optimization
24  * Author:      Michael Beck
25  * Modified by:
26  * Created:     03.11.2005
27  * CVS-ID:      $Id$
28  * Copyright:   (c) 1999-2005 Universität Karlsruhe
29  */
30 #ifndef _IR_OPT_ESCAPE_ANA_H_
31 #define _IR_OPT_ESCAPE_ANA_H_
32
33 #include "firm_types.h"
34
35 /**
36  * Do simple and fast escape analysis for one graph.
37  *
38  * @param irg  the graph
39  */
40 void escape_enalysis_irg(ir_graph *irg);
41
42 /**
43  * Do simple and fast escape analysis for all graphs.
44  *
45  * This optimization implements a simple and fast but inexact
46  * escape analysis. Some addresses might be marked as 'escaped' even
47  * if they are not.
48  * The advantage is a low memory footprint and fast speed.
49  *
50  * @param run_scalar_replace  if this flag in non-zero, scalar
51  *                            replacement optimization is run on graphs with removed
52  *                            allocation
53  *
54  * This optimization removes allocation which are not used (rare) and replace
55  * allocation that can be proved dead at the end of the graph which stack variables.
56  *
57  * The creation of stack variable allows scalar replacement to be run only
58  * on those graphs that have been changed.
59  *
60  * This is most effective on Java where no other stack variables exists.
61  */
62 void escape_analysis(int run_scalar_replace);
63
64 #endif /* _IR_OPT_ESCAPE_ANA_H_ */