X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Ffunccall.h;h=2db2aaf83b94ff74f2c1bd2e865bacb18f1781a2;hb=5b531196b533cdb7ac16df65f200ad2cad08ba40;hp=3d11eb7e71fb0a979e4ce11b87874b19a419ff9d;hpb=34a7a1cf3b1e1771c34367ba352798fead1d9904;p=libfirm diff --git a/ir/opt/funccall.h b/ir/opt/funccall.h index 3d11eb7e7..2db2aaf83 100644 --- a/ir/opt/funccall.h +++ b/ir/opt/funccall.h @@ -20,21 +20,38 @@ #define _FUNCCALL_H_ /** - * Optimize function calls by handling real functions. + * Optimize function calls by handling const functions. * - * This optimization first detects all "real fucntions", ie + * This optimization first detects all "const functions", i.e., * IR graphs that neither read nor write memory (and hence did * not create exceptions, as these use memory in Firm). * * The result of calls to such functions depends only on its - * arguments, hence those calls are not anymore pinned. + * arguments, hence those calls are no more pinned. * * This is a rather strong criteria, so do not expect that a * lot of functions will be found. Moreover, all of them might * already be inlined if inlining is activated. * Anyway, it might be good for handling builtin's or pseudo-graphs, * even if the later read/write memory (but we know how). + * + * This optimizations read the irg_const_function property of + * entities and and sets the irg_const_function property of + * graphs. + * + * If callee information is valid, we also optimize polymorphic Calls. + * + * @param force_run if set, an optimization run is startet even + * if no const function graph was detected. + * Else calls are only optimized if at least one + * const function graph was detected. + * + * If the fontend created external entities with irg_const_function + * property set, the force_run parameter should be set, else + * should be unset. + * + * @note This optimization destroys the link fields of nodes. */ -void optimize_funccalls(void); +void optimize_funccalls(int force_run); #endif /* _FUNCCALL_H_ */