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 * File name: ir/opt/escape_ana.h
23 * Purpose: escape analysis and optimization
24 * Author: Michael Beck
28 * Copyright: (c) 1999-2005 Universität Karlsruhe
30 #ifndef _IR_OPT_ESCAPE_ANA_H_
31 #define _IR_OPT_ESCAPE_ANA_H_
33 #include "firm_types.h"
36 * Do simple and fast escape analysis for one graph.
38 * @param irg the graph
40 void escape_enalysis_irg(ir_graph *irg);
43 * Do simple and fast escape analysis for all graphs.
45 * This optimization implements a simple and fast but inexact
46 * escape analysis. Some addresses might be marked as 'escaped' even
48 * The advantage is a low memory footprint and fast speed.
50 * @param run_scalar_replace if this flag in non-zero, scalar
51 * replacement optimization is run on graphs with removed
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.
57 * The creation of stack variable allows scalar replacement to be run only
58 * on those graphs that have been changed.
60 * This is most effective on Java where no other stack variables exists.
62 void escape_analysis(int run_scalar_replace);
64 #endif /* _IR_OPT_ESCAPE_ANA_H_ */