diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-11-18 21:44:16 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-11-18 20:44:16 +0000 |
commit | 2bf86c845a89fce00ccb219adbf6002443b5b1cb (patch) | |
tree | 78111324e160451c1d54ce78b9af90a1e98ffa12 /gcc/ipa-prop.c | |
parent | bb59f396f8ca74c7d663c197e99d15bbe9f6e5b6 (diff) | |
download | gcc-2bf86c845a89fce00ccb219adbf6002443b5b1cb.zip gcc-2bf86c845a89fce00ccb219adbf6002443b5b1cb.tar.gz gcc-2bf86c845a89fce00ccb219adbf6002443b5b1cb.tar.bz2 |
ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
* ipa-cp.c (ipcp_cloning_candidate_p): Use opt_for_fn.
(ipa_value_from_jfunc, ipa_context_from_jfunc): Skip sanity check.
(ipa_get_indirect_edge_target_1): Use opt_for_fn.
(good_cloning_opportunity_p): Likewise.
(ipa-cp gate): Enable ipa-cp with LTO.
* ipa-profile.c (ipa_propagate_frequency): Use opt_for_fn.
* ipa.c (symbol_table::remove_unreachable_nodes): Always build type
inheritance.
* ipa-inline-transform.c (inline_transform): Check if there are inlines
to apply even at -O0.
* cgraphunit.c (cgraph_node::finalize_function): Use opt_for_fn.
(analyze_functions): Build type inheritance graph.
* ipa-inline.c (can_inline_edge_p): Use opt_for_fn.
(want_early_inline_function_p, want_inline_small_function_p):
Likewise.
(check_callers): Likewise.
(edge_badness): Likewise.
(inline_small_functions): Always be ready for indirect inlining
to happend.
(ipa_inline): Always use want_inline_function_to_all_callers_p.
(early_inline_small_functions): Use opt_for_fn.
* ipa-inline-analysis.c (estimate_function_body_sizes): use opt_for_fn.
(estimate_function_body_sizes): Likewise.
(compute_inline_parameters): Likewise.
(estimate_edge_devirt_benefit): Likewise.
(inline_analyze_function): Likewise.
* ipa-devirt.c (ipa_devirt): Likewise.
(gate): Use in_lto_p.
* ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): Use opt_for_fn.
(try_make_edge_direct_virtual_call): Likewise.
(update_indirect_edges_after_inlining): Likewise.
(ipa_free_all_structures_after_ipa_cp): Add in_lto_p check.
* common.opt (findirect-inlining): Turn into optimization.
* ipa-pure-const.c (add_new_function): Use opt_for_fn.
(pure_const_generate_summary): Likewise.
(gate_pure_const): Always enable with in_lto_p.
From-SVN: r217737
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index f87243c..6905f0c 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -168,12 +168,10 @@ static bool ipa_func_spec_opts_forbid_analysis_p (struct cgraph_node *node) { tree fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl); - struct cl_optimization *os; if (!fs_opts) return false; - os = TREE_OPTIMIZATION (fs_opts); - return !os->x_optimize || !os->x_flag_ipa_cp; + return !opt_for_fn (node->decl, optimize) || !opt_for_fn (node->decl, flag_ipa_cp); } /* Return index of the formal whose tree is PTREE in function which corresponds @@ -2896,13 +2894,14 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, tree target = NULL; bool speculative = false; - if (!flag_devirtualize) + if (!opt_for_fn (ie->caller->decl, flag_devirtualize)) return NULL; gcc_assert (!ie->indirect_info->by_ref); /* Try to do lookup via known virtual table pointer value. */ - if (!ie->indirect_info->vptr_changed || flag_devirtualize_speculatively) + if (!ie->indirect_info->vptr_changed + || opt_for_fn (ie->caller->decl, flag_devirtualize_speculatively)) { tree vtable; unsigned HOST_WIDE_INT offset; @@ -2953,7 +2952,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, else target = ipa_impossible_devirt_target (ie, NULL_TREE); } - else if (!target && flag_devirtualize_speculatively + else if (!target && opt_for_fn (ie->caller->decl, flag_devirtualize_speculatively) && !ie->speculative && ie->maybe_hot_p ()) { cgraph_node *n; @@ -3025,7 +3024,7 @@ update_indirect_edges_after_inlining (struct cgraph_edge *cs, param_index = ici->param_index; jfunc = ipa_get_ith_jump_func (top, param_index); - if (!flag_indirect_inlining) + if (!opt_for_fn (node->decl, flag_indirect_inlining)) new_direct_edge = NULL; else if (ici->polymorphic) { @@ -3579,7 +3578,7 @@ ipa_unregister_cgraph_hooks (void) void ipa_free_all_structures_after_ipa_cp (void) { - if (!optimize) + if (!optimize && !in_lto_p) { ipa_free_all_edge_args (); ipa_free_all_node_params (); |