Commit 5970b079 by Eric Botcazou

ipa-inline.c (want_inline_small_function_p): Fix typo and formatting.

	* ipa-inline.c (want_inline_small_function_p): Fix typo and formatting.
	(want_inline_function_to_all_callers_p): Fix formatting and simplify.

From-SVN: r216973
parent 3012e0ab
2014-10-31 Eric Botcazou <ebotcazou@adacore.com>
* ipa-inline.c (want_inline_small_function_p): Fix typo and formatting.
(want_inline_function_to_all_callers_p): Fix formatting and simplify.
2014-10-31 Thomas Preud'homme <thomas.preudhomme@arm.com> 2014-10-31 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR tree-optimization/63259 PR tree-optimization/63259
...@@ -19,7 +24,7 @@ ...@@ -19,7 +24,7 @@
* ipa-icf.c (sem_function::~sem_function): Change free to delete to avoid * ipa-icf.c (sem_function::~sem_function): Change free to delete to avoid
alloc-dealloc mismatch with new, called in ipa_icf::sem_function::init. alloc-dealloc mismatch with new, called in ipa_icf::sem_function::init.
2014-10-10 Felix Yang <felix.yang@huawei.com> 2014-10-30 Felix Yang <felix.yang@huawei.com>
* config/xtensa/xtensa.h (TARGET_LOOPS): New Macro. * config/xtensa/xtensa.h (TARGET_LOOPS): New Macro.
* config/xtensa/xtensa.c: Include dumpfile.h and hw-doloop.h. * config/xtensa/xtensa.c: Include dumpfile.h and hw-doloop.h.
...@@ -590,19 +590,21 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report) ...@@ -590,19 +590,21 @@ want_inline_small_function_p (struct cgraph_edge *e, bool report)
want_inline = false; want_inline = false;
} }
/* Do fast and conservative check if the function can be good /* Do fast and conservative check if the function can be good
inline cnadidate. At themoment we allow inline hints to inline candidate. At the moment we allow inline hints to
promote non-inline function to inline and we increase promote non-inline functions to inline and we increase
MAX_INLINE_INSNS_SINGLE 16fold for inline functions. */ MAX_INLINE_INSNS_SINGLE 16-fold for inline functions. */
else if ((!DECL_DECLARED_INLINE_P (callee->decl) else if ((!DECL_DECLARED_INLINE_P (callee->decl)
&& (!e->count || !e->maybe_hot_p ())) && (!e->count || !e->maybe_hot_p ()))
&& inline_summary (callee)->min_size - inline_edge_summary (e)->call_stmt_size && inline_summary (callee)->min_size
- inline_edge_summary (e)->call_stmt_size
> MAX (MAX_INLINE_INSNS_SINGLE, MAX_INLINE_INSNS_AUTO)) > MAX (MAX_INLINE_INSNS_SINGLE, MAX_INLINE_INSNS_AUTO))
{ {
e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT; e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
want_inline = false; want_inline = false;
} }
else if ((DECL_DECLARED_INLINE_P (callee->decl) || e->count) else if ((DECL_DECLARED_INLINE_P (callee->decl) || e->count)
&& inline_summary (callee)->min_size - inline_edge_summary (e)->call_stmt_size && inline_summary (callee)->min_size
- inline_edge_summary (e)->call_stmt_size
> 16 * MAX_INLINE_INSNS_SINGLE) > 16 * MAX_INLINE_INSNS_SINGLE)
{ {
e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl) e->inline_failed = (DECL_DECLARED_INLINE_P (callee->decl)
...@@ -836,27 +838,26 @@ has_caller_p (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED) ...@@ -836,27 +838,26 @@ has_caller_p (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
static bool static bool
want_inline_function_to_all_callers_p (struct cgraph_node *node, bool cold) want_inline_function_to_all_callers_p (struct cgraph_node *node, bool cold)
{ {
struct cgraph_node *function = node->ultimate_alias_target (); bool has_hot_call = false;
bool has_hot_call = false;
if (node->ultimate_alias_target () != node)
/* Does it have callers? */ return false;
if (!node->call_for_symbol_thunks_and_aliases (has_caller_p, NULL, true)) /* Already inlined? */
return false; if (node->global.inlined_to)
/* Already inlined? */ return false;
if (function->global.inlined_to) /* Does it have callers? */
return false; if (!node->call_for_symbol_thunks_and_aliases (has_caller_p, NULL, true))
if (node->ultimate_alias_target () != node) return false;
return false; /* Inlining into all callers would increase size? */
/* Inlining into all callers would increase size? */ if (estimate_growth (node) > 0)
if (estimate_growth (node) > 0) return false;
return false; /* All inlines must be possible. */
/* All inlines must be possible. */ if (node->call_for_symbol_thunks_and_aliases (check_callers, &has_hot_call,
if (node->call_for_symbol_thunks_and_aliases true))
(check_callers, &has_hot_call, true)) return false;
return false; if (!cold && !has_hot_call)
if (!cold && !has_hot_call) return false;
return false; return true;
return true;
} }
#define RELATIVE_TIME_BENEFIT_RANGE (INT_MAX / 64) #define RELATIVE_TIME_BENEFIT_RANGE (INT_MAX / 64)
......
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