summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-07-07 15:28:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2017-07-07 13:28:35 +0000
commit29f1e2b173f1701b66410bc3624a989e98e23724 (patch)
treeb2b3db83fc40d137f7bde2edb4558d282d409c6a /gcc/ipa.c
parent8b42ccf6ddfbb350776d0c1b22bddbe9ff634b48 (diff)
ipa-comdats.c: Remove optimize check from gate.
* ipa-comdats.c: Remove optimize check from gate. * ipa-fnsummary.c (ipa_fn_summary_generate): do not generate summary for functions not optimized. (ipa_fn_summary_read): Skip optimize check. (ipa_fn_summary_write): Likewise. * ipa-inline-analysis.c (do_estimate_growth_1): Check that caller is optimized. * ipa-inline.c (can_inline_edge_p): Not optimized functions are uninlinable. (can_inline_edge_p): Check flag_pcc_struct_return for match. (check_callers): Give up on caller which is not optimized. (inline_small_functions): Likewise. (ipa_inline): Do not give up when not optimizing. * ipa-visbility.c (function_and_variable_visibility): Do not optimize away unoptimizes cdtors. (whole_program_function_and_variable_visibility): Do ipa_discover_readonly_nonaddressable_vars in LTO mode. * ipa.c (process_references): Do not check optimize. (symbol_table::remove_unreachable_nodes): Update optimize check. (set_writeonly_bit): Update optimize check. (pass_ipa_cdtor_merge::gate): Do not check optimize. (pass_ipa_single_use::gate): Remove. From-SVN: r250048
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 3dc8e41a7ff..00cd3084f66 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -118,8 +118,7 @@ process_references (symtab_node *snode,
if (node->definition && !node->in_other_partition
&& ((!DECL_EXTERNAL (node->decl) || node->alias)
|| (((before_inlining_p
- && ((TREE_CODE (node->decl) != FUNCTION_DECL
- && optimize)
+ && (TREE_CODE (node->decl) != FUNCTION_DECL
|| (TREE_CODE (node->decl) == FUNCTION_DECL
&& opt_for_fn (body->decl, optimize))
|| (symtab->state < IPA_SSA
@@ -312,7 +311,7 @@ symbol_table::remove_unreachable_nodes (FILE *file)
hash_set<symtab_node *> reachable;
hash_set<tree> body_needed_for_clonning;
hash_set<void *> reachable_call_targets;
- bool before_inlining_p = symtab->state < (!optimize ? IPA_SSA
+ bool before_inlining_p = symtab->state < (!optimize && !in_lto_p ? IPA_SSA
: IPA_SSA_AFTER_INLINING);
timevar_push (TV_IPA_UNREACHABLE);
@@ -696,7 +695,7 @@ symbol_table::remove_unreachable_nodes (FILE *file)
symtab_node::checking_verify_symtab_nodes ();
/* If we removed something, perhaps profile could be improved. */
- if (changed && optimize && ipa_call_summaries)
+ if (changed && (optimize || in_lto_p) && ipa_call_summaries)
FOR_EACH_DEFINED_FUNCTION (node)
ipa_propagate_frequency (node);
@@ -757,7 +756,7 @@ bool
set_writeonly_bit (varpool_node *vnode, void *data)
{
vnode->writeonly = true;
- if (optimize)
+ if (optimize || in_lto_p)
{
DECL_INITIAL (vnode->decl) = NULL;
if (!vnode->alias)
@@ -1175,7 +1174,7 @@ pass_ipa_cdtor_merge::gate (function *)
/* Perform the pass when we have no ctors/dtors support
or at LTO time to merge multiple constructors into single
function. */
- return !targetm.have_ctors_dtors || (optimize && in_lto_p);
+ return !targetm.have_ctors_dtors || in_lto_p;
}
} // anon namespace
@@ -1387,17 +1386,10 @@ public:
{}
/* opt_pass methods: */
- virtual bool gate (function *);
virtual unsigned int execute (function *) { return ipa_single_use (); }
}; // class pass_ipa_single_use
-bool
-pass_ipa_single_use::gate (function *)
-{
- return optimize;
-}
-
} // anon namespace
ipa_opt_pass_d *