aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-10 12:25:38 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-10 11:25:38 +0000
commit6cf67b62c8cda035dccaca2ae6ff94d560b37a6f (patch)
tree9a7cb2284e26f6d8f59e018c743ebdf3a8f7c3ce /gcc/ipa-prop.c
parent64166bf04b869e93570f8e728f4a71bb06d02ab8 (diff)
downloadgcc-6cf67b62c8cda035dccaca2ae6ff94d560b37a6f.zip
gcc-6cf67b62c8cda035dccaca2ae6ff94d560b37a6f.tar.gz
gcc-6cf67b62c8cda035dccaca2ae6ff94d560b37a6f.tar.bz2
cgraph.h (struct cgraph_node): Add ipcp_clone flag.
* cgraph.h (struct cgraph_node): Add ipcp_clone flag. (cgraph_node::create_virtual_clone): Copy it. * ipa-cp.c (ipcp_versionable_function_p): Watch for missing summaries. (ignore_edge_p): If caller has ipa-cp disabled, skip the edge, too. (ipcp_verify_propagated_values): Do not verify nodes where ipcp is disabled. (propagate_constants_across_call): If callee is not analyzed, give up. (propagate_constants_topo): Lower to bottom latties of all callees of functions with ipa-cp disabled. (ipcp_propagate_stage): Skip functions with ipa-cp disabled. (cgraph_edge_brings_value_p): Check for availability first. (create_specialized_node): Set ipcp_clone. (ipcp_store_bits_results): Check that info is present. * ipa-fnsummary.c (evaluate_properties_for_edge): Do not analyze thunks. (ipa_call_context::duplicate_from, ipa_call_context::equal_to): Be conservative when callee summary is missing. (remap_edge_summaries): Lookup call summary only when needed. * ipa-icf.c (sem_function::param_used_p): Be ready for missing summary. * ipa-prpo.c (ipa_alloc_node_params, ipa_initialize_node_params): Use get_create. (ipa_analyze_node): Use get_create. (propagate_controlled_uses): Do not propagate when function is not analyzed. (ipa_propagate_indirect_call_infos): Remove summary of inline clone. (ipa_read_node_info): Use get_create. * ipa-prop.h (IPA_NODE_REF): Use get. (IPA_NODE_REF_GET_CREATE): New. From-SVN: r278016
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index ff6f25a..eb783e6 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -271,7 +271,7 @@ ipa_dump_param (FILE *file, class ipa_node_params *info, int i)
static bool
ipa_alloc_node_params (struct cgraph_node *node, int param_count)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ class ipa_node_params *info = IPA_NODE_REF_GET_CREATE (node);
if (!info->descriptors && param_count)
{
@@ -289,7 +289,7 @@ ipa_alloc_node_params (struct cgraph_node *node, int param_count)
void
ipa_initialize_node_params (struct cgraph_node *node)
{
- class ipa_node_params *info = IPA_NODE_REF (node);
+ class ipa_node_params *info = IPA_NODE_REF_GET_CREATE (node);
if (!info->descriptors
&& ipa_alloc_node_params (node, count_formal_params (node->decl)))
@@ -2605,7 +2605,7 @@ ipa_analyze_node (struct cgraph_node *node)
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
- info = IPA_NODE_REF (node);
+ info = IPA_NODE_REF_GET_CREATE (node);
if (info->analysis_done)
return;
@@ -3601,6 +3601,9 @@ propagate_controlled_uses (struct cgraph_edge *cs)
class ipa_node_params *old_root_info = IPA_NODE_REF (cs->callee);
int count, i;
+ if (!old_root_info)
+ return;
+
count = MIN (ipa_get_cs_argument_count (args),
ipa_get_param_count (old_root_info));
for (i = 0; i < count; i++)
@@ -3662,8 +3665,8 @@ propagate_controlled_uses (struct cgraph_edge *cs)
clone = cs->caller;
while (clone->inlined_to
- && clone != rdesc->cs->caller
- && IPA_NODE_REF (clone)->ipcp_orig_node)
+ && clone->ipcp_clone
+ && clone != rdesc->cs->caller)
{
struct ipa_ref *ref;
ref = clone->find_reference (n, NULL, 0);
@@ -3722,6 +3725,7 @@ ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
propagate_controlled_uses (cs);
changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
+ ipa_node_params_sum->remove (cs->callee);
return changed;
}
@@ -4507,7 +4511,8 @@ ipa_read_node_info (class lto_input_block *ib, struct cgraph_node *node,
struct cgraph_edge *e;
struct bitpack_d bp;
bool prevails = node->prevailing_p ();
- class ipa_node_params *info = prevails ? IPA_NODE_REF (node) : NULL;
+ class ipa_node_params *info = prevails
+ ? IPA_NODE_REF_GET_CREATE (node) : NULL;
int param_count = streamer_read_uhwi (ib);
if (prevails)