summaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-18 20:44:16 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-18 20:44:16 +0000
commitd1f68cd8ba4f36a06a74ba74fbe6a137a43846d6 (patch)
tree78111324e160451c1d54ce78b9af90a1e98ffa12 /gcc/ipa-pure-const.c
parenta2803f7ab078bf6e2ef0d6d98104720e5db6e71f (diff)
downloadgcc-d1f68cd8ba4f36a06a74ba74fbe6a137a43846d6.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217737 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index a55288d7ba4..50d7300cc4f 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -914,7 +914,8 @@ add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
static declarations. We do not need to scan them more than once
since all we would be interested in are the addressof
operations. */
- if (node->get_availability () > AVAIL_INTERPOSABLE)
+ if (node->get_availability () > AVAIL_INTERPOSABLE
+ && opt_for_fn (node->decl, flag_ipa_pure_const))
set_function_state (node, analyze_function (node, true));
}
@@ -984,7 +985,8 @@ pure_const_generate_summary (void)
when function got cloned and the clone is AVAILABLE. */
FOR_EACH_DEFINED_FUNCTION (node)
- if (node->get_availability () >= AVAIL_INTERPOSABLE)
+ if (node->get_availability () >= AVAIL_INTERPOSABLE
+ && opt_for_fn (node->decl, flag_ipa_pure_const))
set_function_state (node, analyze_function (node, true));
}
@@ -1595,9 +1597,7 @@ execute (function *)
static bool
gate_pure_const (void)
{
- return (flag_ipa_pure_const
- /* Don't bother doing anything if the program has errors. */
- && !seen_error ());
+ return flag_ipa_pure_const || in_lto_p;
}
pass_ipa_pure_const::pass_ipa_pure_const(gcc::context *ctxt)