3 * File name: ir/opt/ldstopt.h
4 * Purpose: optimization of real function calls
8 * Copyright: (c) 1998-2005 Universität Karlsruhe
9 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
15 * Optimization of real function calls.
17 * @author Michael Beck
23 * Optimize function calls by handling const functions.
25 * This optimization first detects all "const functions", i.e.,
26 * IR graphs that neither read nor write memory (and hence did
27 * not create exceptions, as these use memory in Firm).
29 * The result of calls to such functions depends only on its
30 * arguments, hence those calls are no more pinned.
32 * This is a rather strong criteria, so do not expect that a
33 * lot of functions will be found. Moreover, all of them might
34 * already be inlined if inlining is activated.
35 * Anyway, it might be good for handling builtin's or pseudo-graphs,
36 * even if the later read/write memory (but we know how).
38 * This optimizations read the irg_const_function property of
39 * entities and and sets the irg_const_function property of
42 * If callee information is valid, we also optimize polymorphic Calls.
44 * @param force_run if set, an optimization run is startet even
45 * if no const function graph was detected.
46 * Else calls are only optimized if at least one
47 * const function graph was detected.
49 * If the fontend created external entities with irg_const_function
50 * property set, the force_run parameter should be set, else
53 * @note This optimization destroys the link fields of nodes.
55 void optimize_funccalls(int force_run);
57 #endif /* _FUNCCALL_H_ */