From ff302741f10c7d6f014eb46f7632b57bdc43a4f5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 15 Jul 2015 15:58:43 +0000 Subject: Limit AA walking when inlining analysis examines parameters 2015-07-15 Paolo Bonzini Martin Jambor * ipa-inline-analysis.c (unmodified_parm_or_parm_agg_item): Accept struct func_body_info* instead of struct ipa_node_params*, expecting fbi->info to be filled in. Replace throughout. Adjust call to ipa_load_from_parm_agg. (set_cond_stmt_execution_predicate): Accept struct func_body_info* instead of struct ipa_node_params*. Adjust calls to other functions so that they pass either fbi or fbi->info. (set_switch_stmt_execution_predicate): Likewise. (will_be_nonconstant_predicate): Likewise. (compute_bb_predicates): Likewise. (estimate_function_body_sizes): Move asserts earlier. Fill in struct func_body_info, replace parms_info with fbi.info. Adjust calls to functions that now accept struct func_body_info. * ipa-prop.c (param_aa_status, struct ipa_bb_info): Move to ipa-prop.h. (struct func_body_info): Likewise. (ipa_load_from_parm_agg_1): Rename to ipa_load_from_parm_agg, remove static. Adjust callers. (ipa_load_from_parm_agg): Remove. * ipa-prop.h (param_aa_status, ipa_bb_info): Move from ipa-prop.c. (func_body_info): Likewise. (ipa_load_from_parm_agg): Adjust prototype. Co-Authored-By: Martin Jambor From-SVN: r225838 --- gcc/ipa-prop.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) (limited to 'gcc/ipa-prop.h') diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index c495894..a6b26b8 100644 --- a/gcc/ipa-prop.h +++ b/gcc/ipa-prop.h @@ -336,6 +336,57 @@ struct ipa_node_params unsigned node_calling_single_call : 1; }; +/* Intermediate information that we get from alias analysis about a particular + parameter in a particular basic_block. When a parameter or the memory it + references is marked modified, we use that information in all dominatd + blocks without cosulting alias analysis oracle. */ + +struct param_aa_status +{ + /* Set when this structure contains meaningful information. If not, the + structure describing a dominating BB should be used instead. */ + bool valid; + + /* Whether we have seen something which might have modified the data in + question. PARM is for the parameter itself, REF is for data it points to + but using the alias type of individual accesses and PT is the same thing + but for computing aggregate pass-through functions using a very inclusive + ao_ref. */ + bool parm_modified, ref_modified, pt_modified; +}; + +/* Information related to a given BB that used only when looking at function + body. */ + +struct ipa_bb_info +{ + /* Call graph edges going out of this BB. */ + vec cg_edges; + /* Alias analysis statuses of each formal parameter at this bb. */ + vec param_aa_statuses; +}; + +/* Structure with global information that is only used when looking at function + body. */ + +struct func_body_info +{ + /* The node that is being analyzed. */ + cgraph_node *node; + + /* Its info. */ + struct ipa_node_params *info; + + /* Information about individual BBs. */ + vec bb_infos; + + /* Number of parameters. */ + int param_count; + + /* Number of statements already walked by when analyzing this function. */ + unsigned int aa_walked; +}; + /* ipa_node_params access functions. Please use these to access fields that are or will be shared among various passes. */ @@ -585,8 +636,9 @@ void ipa_analyze_node (struct cgraph_node *); /* Aggregate jump function related functions. */ tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *, HOST_WIDE_INT, bool); -bool ipa_load_from_parm_agg (struct ipa_node_params *, gimple, tree, int *, - HOST_WIDE_INT *, bool *); +bool ipa_load_from_parm_agg (struct func_body_info *, + vec, gimple, tree, int *, + HOST_WIDE_INT *, HOST_WIDE_INT *, bool *); /* Debugging interface. */ void ipa_print_node_params (FILE *, struct cgraph_node *node); -- cgit v1.1