Commit 1d51f406 by Richard Guenther Committed by Richard Biener

c-objc-common.c (c_disregard_inline_limits): Remove.

2007-08-20  Richard Guenther  <rguenther@suse.de>

	* c-objc-common.c (c_disregard_inline_limits): Remove.
	* c-objc-common.h (c_disregard_inline_limits): Likewise.
	* cgraphunit.c (cgraph_process_new_functions): Call
	disregard_inline_limits_p.
	(cgraph_preserve_function_body_p): Likewise.
	* ipa-inline.c (compute_inline_parameters): Likewise.
	* langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
	Remove.
	(LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
	(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
	disregard_inline_limits langhook.
	* langhooks.c (lhd_tree_inlining_disregard_inline_limits):
	Remove.
	* langhooks.h (lang_hooks_for_tree_inlining): Remove
	disregard_inline_limits langhook.
	* tree-inline.c (disregard_inline_limits_p): New function.
	* tree-inline.h (disregard_inline_limits_p): Declare.

From-SVN: r127644
parent 50886bf1
2007-08-20 Richard Guenther <rguenther@suse.de> 2007-08-20 Richard Guenther <rguenther@suse.de>
* c-objc-common.c (c_disregard_inline_limits): Remove.
* c-objc-common.h (c_disregard_inline_limits): Likewise.
* cgraphunit.c (cgraph_process_new_functions): Call
disregard_inline_limits_p.
(cgraph_preserve_function_body_p): Likewise.
* ipa-inline.c (compute_inline_parameters): Likewise.
* langhooks-def.h (lhd_tree_inlining_disregard_inline_limits):
Remove.
(LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS): Remove.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
disregard_inline_limits langhook.
* langhooks.c (lhd_tree_inlining_disregard_inline_limits):
Remove.
* langhooks.h (lang_hooks_for_tree_inlining): Remove
disregard_inline_limits langhook.
* tree-inline.c (disregard_inline_limits_p): New function.
* tree-inline.h (disregard_inline_limits_p): Declare.
2007-08-20 Richard Guenther <rguenther@suse.de>
* langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove. * langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
(LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise. (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise.
(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
......
...@@ -50,20 +50,6 @@ c_missing_noreturn_ok_p (tree decl) ...@@ -50,20 +50,6 @@ c_missing_noreturn_ok_p (tree decl)
return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl)); return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
} }
/* We want to inline `extern inline' functions even if this would
violate inlining limits. Some glibc and linux constructs depend on
such functions always being inlined when optimizing. */
int
c_disregard_inline_limits (const_tree fn)
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
return 1;
return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
&& DECL_EXTERNAL (fn));
}
int int
c_cannot_inline_tree_fn (tree *fnp) c_cannot_inline_tree_fn (tree *fnp)
{ {
......
...@@ -85,9 +85,6 @@ extern void c_initialize_diagnostics (diagnostic_context *); ...@@ -85,9 +85,6 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN #undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
c_cannot_inline_tree_fn c_cannot_inline_tree_fn
#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
c_disregard_inline_limits
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN #undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree #define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree
......
...@@ -381,7 +381,7 @@ cgraph_process_new_functions (void) ...@@ -381,7 +381,7 @@ cgraph_process_new_functions (void)
node->local.self_insns = estimate_num_insns (fndecl, node->local.self_insns = estimate_num_insns (fndecl,
&eni_inlining_weights); &eni_inlining_weights);
node->local.disregard_inline_limits node->local.disregard_inline_limits
|= lang_hooks.tree_inlining.disregard_inline_limits (fndecl); |= disregard_inline_limits_p (fndecl);
/* Inlining characteristics are maintained by the /* Inlining characteristics are maintained by the
cgraph_mark_inline. */ cgraph_mark_inline. */
node->global.insns = node->local.self_insns; node->global.insns = node->local.self_insns;
...@@ -1252,7 +1252,7 @@ cgraph_preserve_function_body_p (tree decl) ...@@ -1252,7 +1252,7 @@ cgraph_preserve_function_body_p (tree decl)
struct cgraph_node *node; struct cgraph_node *node;
if (!cgraph_global_info_ready) if (!cgraph_global_info_ready)
return (flag_really_no_inline return (flag_really_no_inline
? lang_hooks.tree_inlining.disregard_inline_limits (decl) ? disregard_inline_limits_p (decl)
: DECL_INLINE (decl)); : DECL_INLINE (decl));
/* Look if there is any clone around. */ /* Look if there is any clone around. */
for (node = cgraph_node (decl); node; node = node->next_clone) for (node = cgraph_node (decl); node; node = node->next_clone)
......
...@@ -1529,7 +1529,7 @@ compute_inline_parameters (void) ...@@ -1529,7 +1529,7 @@ compute_inline_parameters (void)
&eni_inlining_weights); &eni_inlining_weights);
if (node->local.inlinable && !node->local.disregard_inline_limits) if (node->local.inlinable && !node->local.disregard_inline_limits)
node->local.disregard_inline_limits node->local.disregard_inline_limits
= lang_hooks.tree_inlining.disregard_inline_limits (current_function_decl); = disregard_inline_limits_p (current_function_decl);
if (flag_really_no_inline && !node->local.disregard_inline_limits) if (flag_really_no_inline && !node->local.disregard_inline_limits)
node->local.inlinable = 0; node->local.inlinable = 0;
/* Inlining characteristics are maintained by the cgraph_mark_inline. */ /* Inlining characteristics are maintained by the cgraph_mark_inline. */
......
...@@ -69,7 +69,6 @@ extern tree lhd_builtin_function (tree decl); ...@@ -69,7 +69,6 @@ extern tree lhd_builtin_function (tree decl);
/* Declarations of default tree inlining hooks. */ /* Declarations of default tree inlining hooks. */
extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *); extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *);
extern int lhd_tree_inlining_disregard_inline_limits (const_tree);
extern void lhd_initialize_diagnostics (struct diagnostic_context *); extern void lhd_initialize_diagnostics (struct diagnostic_context *);
extern tree lhd_callgraph_analyze_expr (tree *, int *, tree); extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
...@@ -134,14 +133,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, ...@@ -134,14 +133,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
/* Tree inlining hooks. */ /* Tree inlining hooks. */
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \ #define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
lhd_tree_inlining_cannot_inline_tree_fn lhd_tree_inlining_cannot_inline_tree_fn
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
lhd_tree_inlining_disregard_inline_limits
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \ #define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P \
hook_bool_tree_tree_false hook_bool_tree_tree_false
#define LANG_HOOKS_TREE_INLINING_INITIALIZER { \ #define LANG_HOOKS_TREE_INLINING_INITIALIZER { \
LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \ LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, \
LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS, \
LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \ LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, \
} }
......
...@@ -290,19 +290,6 @@ lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp) ...@@ -290,19 +290,6 @@ lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp)
return 0; return 0;
} }
/* lang_hooks.tree_inlining.disregard_inline_limits is called to
determine whether a function should be considered for inlining even
if it would exceed inlining limits. */
int
lhd_tree_inlining_disregard_inline_limits (const_tree fn)
{
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
return 1;
return 0;
}
/* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree /* lang_hooks.tree_dump.dump_tree: Dump language-specific parts of tree
nodes. Returns nonzero if it does not want the usual dumping of the nodes. Returns nonzero if it does not want the usual dumping of the
second argument. */ second argument. */
......
...@@ -36,7 +36,6 @@ typedef void (*lang_print_tree_hook) (FILE *, tree, int indent); ...@@ -36,7 +36,6 @@ typedef void (*lang_print_tree_hook) (FILE *, tree, int indent);
struct lang_hooks_for_tree_inlining struct lang_hooks_for_tree_inlining
{ {
int (*cannot_inline_tree_fn) (tree *); int (*cannot_inline_tree_fn) (tree *);
int (*disregard_inline_limits) (const_tree);
bool (*var_mod_type_p) (tree, tree); bool (*var_mod_type_p) (tree, tree);
}; };
......
...@@ -1914,6 +1914,15 @@ inlinable_function_p (tree fn) ...@@ -1914,6 +1914,15 @@ inlinable_function_p (tree fn)
return inlinable; return inlinable;
} }
/* Return true if we shall disregard inlining limits for the function
FN during inlining. */
bool
disregard_inline_limits_p (tree fn)
{
return lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL_TREE;
}
/* Estimate the cost of a memory move. Use machine dependent /* Estimate the cost of a memory move. Use machine dependent
word size and take possible memcpy call into account. */ word size and take possible memcpy call into account. */
......
...@@ -130,6 +130,7 @@ extern void insert_decl_map (copy_body_data *, tree, tree); ...@@ -130,6 +130,7 @@ extern void insert_decl_map (copy_body_data *, tree, tree);
unsigned int optimize_inline_calls (tree); unsigned int optimize_inline_calls (tree);
bool tree_inlinable_function_p (tree); bool tree_inlinable_function_p (tree);
bool disregard_inline_limits_p (tree);
tree copy_tree_r (tree *, int *, void *); tree copy_tree_r (tree *, int *, void *);
void clone_body (tree, tree, void *); void clone_body (tree, tree, void *);
void save_body (tree, tree *, tree *); void save_body (tree, tree *, tree *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment