mirror of
https://review.haiku-os.org/buildtools
synced 2024-11-23 07:18:49 +01:00
[taken from gcc-2.95.3-7-suse]
2001-08-23 Kurt Garloff <kurt@garloff.de> * integrate.c (function_cannot_inline_p): Reduce max size for inlining from 10000 to 2000, double this value (i.e. 4000) for leaf functions. Fine tune INTEGRATE_THRESHOLD for -Os. * toplev.c (rest_of_compilation): Set current_function_is_leaf for function_cannot_inline_p git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9581 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
346d84c900
commit
a7498ab1d3
@ -1,3 +1,11 @@
|
||||
2001-08-23 Kurt Garloff <kurt@garloff.de>
|
||||
|
||||
* integrate.c (function_cannot_inline_p): Reduce max size for
|
||||
inlining from 10000 to 2000, double this value (i.e. 4000) for
|
||||
leaf functions. Fine tune INTEGRATE_THRESHOLD for -Os.
|
||||
* toplev.c (rest_of_compilation): Set current_function_is_leaf
|
||||
for function_cannot_inline_p
|
||||
|
||||
Fri Mar 16 12:46:19 GMT 2001 Bernd Schmidt (bernds@redhat.com)
|
||||
|
||||
* gcc-2.95.3 Released.
|
||||
|
@ -53,11 +53,11 @@ extern struct obstack *function_maybepermanent_obstack;
|
||||
This is overridden on RISC machines. */
|
||||
#ifndef INTEGRATE_THRESHOLD
|
||||
/* Inlining small functions might save more space then not inlining at
|
||||
all. Assume 1 instruction for the call and 1.5 insns per argument. */
|
||||
all. Assume 3 instructions for the call/ret and 4 insns per argument. */
|
||||
#define INTEGRATE_THRESHOLD(DECL) \
|
||||
(optimize_size \
|
||||
? (1 + (3 * list_length (DECL_ARGUMENTS (DECL))) / 2) \
|
||||
: (8 * (8 + list_length (DECL_ARGUMENTS (DECL)))))
|
||||
? ( 3 + ( 4 * list_length (DECL_ARGUMENTS (DECL)))) \
|
||||
: (64 + ( 8 * list_length (DECL_ARGUMENTS (DECL)))))
|
||||
#endif
|
||||
|
||||
static rtx initialize_for_inline PROTO((tree, int, int, int, int));
|
||||
@ -91,10 +91,12 @@ static tree copy_and_set_decl_abstract_origin PROTO((tree));
|
||||
function. Increasing values mean more agressive inlining.
|
||||
This affects currently only functions explicitly marked as
|
||||
inline (or methods defined within the class definition for C++).
|
||||
The default value of 10000 is arbitrary but high to match the
|
||||
previously unlimited gcc capabilities. */
|
||||
The default value of 2000 is much lower than before and
|
||||
matches a bit better with the 3.0.1 numbers.
|
||||
We allow double the size for leaf functions.
|
||||
*/
|
||||
|
||||
int inline_max_insns = 10000;
|
||||
int inline_max_insns = 2000;
|
||||
|
||||
|
||||
/* Returns the Ith entry in the label_map contained in MAP. If the
|
||||
@ -154,6 +156,10 @@ function_cannot_inline_p (fndecl)
|
||||
if (current_function_cannot_inline)
|
||||
return current_function_cannot_inline;
|
||||
|
||||
/* Prefer leaf functions */
|
||||
if (current_function_is_leaf)
|
||||
max_insns *= 2;
|
||||
|
||||
/* If its not even close, don't even look. */
|
||||
if (get_max_uid () > 3 * max_insns)
|
||||
return N_("function too large to be inline");
|
||||
|
@ -2351,11 +2351,15 @@ allows the control of this limit for functions that are explicitly marked as
|
||||
inline (ie marked with the inline keyword or defined within the class
|
||||
definition in c++). @var{n} is the size of functions that can be inlined in
|
||||
number of pseudo instructions (not counting parameter handling). The default
|
||||
value of n is 10000. Increasing this value can result in more inlined code at
|
||||
the cost of compilation time and memory consumption. Decreasing usually makes
|
||||
the compilation faster and less code will be inlined (which presumably
|
||||
means slower programs). This option is particularly useful for programs that
|
||||
use inlining heavily such as those based on recursive templates with c++.
|
||||
value of n is 2000 . Increasing this value (to e.g. 5000) can result in more
|
||||
inlined code at the cost of compilation time and memory consumption and will
|
||||
result in larger excutables. Too much inlining can decrease performance
|
||||
again because of the limited size of your CPU's instruction cache.
|
||||
Decreasing (e.g. to 250) usually makes the compilation faster and less code
|
||||
will be inlined (which presumably means smaller executables but slower
|
||||
programs). This option is particularly useful for programs that use
|
||||
inlining heavily such as those based on recursive templates with c++.
|
||||
Note that functions at the leaf of the call tree get a bonus.
|
||||
|
||||
@emph{Note:} pseudo instruction represents, in this particular context, an
|
||||
abstract measurement of function's size. In no way, it represents a count
|
||||
|
@ -3620,6 +3620,7 @@ rest_of_compilation (decl)
|
||||
if (DECL_INLINE (decl) || flag_inline_functions)
|
||||
TIMEVAR (integration_time,
|
||||
{
|
||||
current_function_is_leaf = leaf_function_p ();
|
||||
lose = function_cannot_inline_p (decl);
|
||||
if (lose || ! optimize)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user