2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief escape analysis and optimization
23 * @author Michael Beck
27 #ifndef FIRM_OPT_IR_OPT_ESCAPE_ANA_H
28 #define FIRM_OPT_IR_OPT_ESCAPE_ANA_H
30 #include "firm_types.h"
33 * Do simple and fast escape analysis for one graph.
35 * @param irg the graph
37 void escape_enalysis_irg(ir_graph *irg);
40 * Do simple and fast escape analysis for all graphs.
42 * This optimization implements a simple and fast but inexact
43 * escape analysis. Some addresses might be marked as 'escaped' even
45 * The advantage is a low memory footprint and fast speed.
47 * @param run_scalar_replace if this flag in non-zero, scalar
48 * replacement optimization is run on graphs with removed
51 * This optimization removes allocation which are not used (rare) and replace
52 * allocation that can be proved dead at the end of the graph which stack variables.
54 * The creation of stack variable allows scalar replacement to be run only
55 * on those graphs that have been changed.
57 * This is most effective on Java where no other stack variables exists.
59 void escape_analysis(int run_scalar_replace);