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/ldstopt.h
23 * Purpose: optimization of real function calls
24 * Author: Michael Beck
27 * Copyright: (c) 1998-2005 Universität Karlsruhe
33 * Optimization of real function calls.
35 * @author Michael Beck
41 * Optimize function calls by handling const functions.
43 * This optimization first detects all "const functions", i.e.,
44 * IR graphs that neither read nor write memory (and hence did
45 * not create exceptions, as these use memory in Firm).
47 * The result of calls to such functions depends only on its
48 * arguments, hence those calls are no more pinned.
50 * This is a rather strong criteria, so do not expect that a
51 * lot of functions will be found. Moreover, all of them might
52 * already be inlined if inlining is activated.
53 * Anyway, it might be good for handling builtin's or pseudo-graphs,
54 * even if the later read/write memory (but we know how).
56 * This optimizations read the irg_const_function property of
57 * entities and and sets the irg_const_function property of
60 * If callee information is valid, we also optimize polymorphic Calls.
62 * @param force_run if set, an optimization run is startet even
63 * if no const function graph was detected.
64 * Else calls are only optimized if at least one
65 * const function graph was detected.
67 * If the fontend created external entities with irg_const_function
68 * property set, the force_run parameter should be set, else
71 * @note This optimization destroys the link fields of nodes.
73 void optimize_funccalls(int force_run);
75 #endif /* _FUNCCALL_H_ */