diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2015-07-15 15:58:43 +0000 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2015-07-15 17:58:43 +0200 |
commit | ff302741f10c7d6f014eb46f7632b57bdc43a4f5 (patch) | |
tree | 127491dc7e4f3bf8622f11581b6fa60ff963f42b /gcc/ipa-prop.h | |
parent | 7392b0906f329b552ab6de61a2248f860acfcd7a (diff) |
Limit AA walking when inlining analysis examines parameters
2015-07-15 Paolo Bonzini <bonzini@gnu.org>
Martin Jambor <mjambor@suse.cz>
* 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 <mjambor@suse.cz>
From-SVN: r225838
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r-- | gcc/ipa-prop.h | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h index c4958948e86..a6b26b8a4f6 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<cgraph_edge *> cg_edges; + /* Alias analysis statuses of each formal parameter at this bb. */ + vec<param_aa_status> 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<ipa_bb_info> 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<ipa_param_descriptor>, gimple, tree, int *, + HOST_WIDE_INT *, HOST_WIDE_INT *, bool *); /* Debugging interface. */ void ipa_print_node_params (FILE *, struct cgraph_node *node); |