diff options
author | Diego Novillo <dnovillo@google.com> | 2009-10-03 21:10:11 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2009-10-03 21:10:11 +0000 |
commit | 93fcd3075033a94fc3e0db811c9aa26a52dd5895 (patch) | |
tree | 3a9882bd235e5026410e5397a5e46a97ece50b48 /gcc/ipa-inline.c | |
parent | a3155ed62fc4ef247ff1b43fca26e5e8222611cc (diff) |
Merge lto branch into trunk.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@152434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 8851d605372..0a02ae1770a 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -326,7 +326,7 @@ cgraph_mark_inline (struct cgraph_edge *edge) struct cgraph_node *what = edge->callee; struct cgraph_edge *e, *next; - gcc_assert (!gimple_call_cannot_inline_p (edge->call_stmt)); + gcc_assert (!edge->call_stmt_cannot_inline_p); /* Look for all calls, mark them inline and clone recursively all inlined functions. */ for (e = what->callers; e; e = next) @@ -1031,7 +1031,7 @@ cgraph_decide_inlining_of_small_functions (void) else { struct cgraph_node *callee; - if (gimple_call_cannot_inline_p (edge->call_stmt) + if (edge->call_stmt_cannot_inline_p || !cgraph_check_inline_limits (edge->caller, edge->callee, &edge->inline_failed, true)) { @@ -1111,7 +1111,13 @@ cgraph_decide_inlining (void) bool redo_always_inline = true; int initial_size = 0; - cgraph_remove_function_insertion_hook (function_insertion_hook_holder); + /* FIXME lto. We need to rethink how to coordinate different passes. */ + if (flag_ltrans) + return 0; + + /* FIXME lto. We need to re-think about how the passes get invoked. */ + if (!flag_wpa) + cgraph_remove_function_insertion_hook (function_insertion_hook_holder); max_count = 0; max_benefit = 0; @@ -1121,7 +1127,6 @@ cgraph_decide_inlining (void) struct cgraph_edge *e; gcc_assert (inline_summary (node)->self_size == node->global.size); - gcc_assert (node->needed || node->reachable); initial_size += node->global.size; for (e = node->callees; e; e = e->next_callee) if (max_count < e->count) @@ -1129,7 +1134,9 @@ cgraph_decide_inlining (void) if (max_benefit < inline_summary (node)->time_inlining_benefit) max_benefit = inline_summary (node)->time_inlining_benefit; } - gcc_assert (!max_count || (profile_info && flag_branch_probabilities)); + gcc_assert (in_lto_p + || !max_count + || (profile_info && flag_branch_probabilities)); overall_size = initial_size; nnodes = cgraph_postorder (order); @@ -1177,8 +1184,7 @@ cgraph_decide_inlining (void) for (e = node->callers; e; e = next) { next = e->next_caller; - if (!e->inline_failed - || gimple_call_cannot_inline_p (e->call_stmt)) + if (!e->inline_failed || e->call_stmt_cannot_inline_p) continue; if (cgraph_recursive_inlining_p (e->caller, e->callee, &e->inline_failed)) @@ -1225,7 +1231,7 @@ cgraph_decide_inlining (void) && node->callers->inline_failed && node->callers->caller != node && node->callers->caller->global.inlined_to != node - && !gimple_call_cannot_inline_p (node->callers->call_stmt) + && !node->callers->call_stmt_cannot_inline_p && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl)) { @@ -1411,7 +1417,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, if (!e->callee->local.disregard_inline_limits && (mode != INLINE_ALL || !e->callee->local.inlinable)) continue; - if (gimple_call_cannot_inline_p (e->call_stmt)) + if (e->call_stmt_cannot_inline_p) continue; /* When the edge is already inlined, we just need to recurse into it in order to fully flatten the leaves. */ @@ -1529,7 +1535,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node, } if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed, false) - || gimple_call_cannot_inline_p (e->call_stmt)) + || e->call_stmt_cannot_inline_p) { if (dump_file) { @@ -1632,6 +1638,7 @@ static bool cgraph_gate_ipa_early_inlining (void) { return (flag_early_inlining + && !in_lto_p && (flag_branch_probabilities || flag_test_coverage || profile_arc_flag)); } @@ -1919,6 +1926,10 @@ inline_generate_summary (void) { struct cgraph_node *node; + /* FIXME lto. We should not run any IPA-summary pass in LTRANS mode. */ + if (flag_ltrans) + return; + function_insertion_hook_holder = cgraph_add_function_insertion_hook (&add_new_function, NULL); |