aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-03 23:32:56 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-03 22:32:56 +0000
commit40a777e840f74dd5c19ea26c55d1248a335fd11b (patch)
treed986b1ce6aa2a9086a52ad6e19d0181b37c71a3c /gcc/ipa-prop.h
parent4bcd578ab4927bc42b72b66d6d4d816ae5598ae7 (diff)
downloadgcc-40a777e840f74dd5c19ea26c55d1248a335fd11b.zip
gcc-40a777e840f74dd5c19ea26c55d1248a335fd11b.tar.gz
gcc-40a777e840f74dd5c19ea26c55d1248a335fd11b.tar.bz2
Improve effectivity of ipa_polymorphi_context cache.
* ipa-fnsummary.c (set_cond_stmt_execution_predicate, set_switch_stmt_execution_predicate, compute_bb_predicates, will_be_nonconstant_expr_predicate, phi_result_unknown_predicate, analyze_function_body): Pass arround params summary. (ipa_call_context::duplicate_from): New comment; only duplicate useful values. (ipa_call_context::equal_to): Only compare useful values. (remap_edge_summaries): Pass params_summary. (remap_hint_predicate): Likewise. (ipa_merge_fn_summary_after_inlining): Likewise. (inline_read_section): Initialize params summary used flags. * ipa-predicate.c (predicate::remap_after_inlining): Pass around param_summary. (add_condition): Initialized used params summary flags. * ipa-predicate.h (inline_param_summary::equals_to): Make const. (inline_param_summary::useless_p): New predicate. (remap_after_inlining, add_condition): Update prototype * ipa-prop.c (ipa_populate_param_decls): Watch overflow in move_cost. (ipa_note_param_call): Add parameter POLYMORPHIC; update params summaries. (ipa_analyze_indirect_call_uses): Update use of ipa_note_param_call. (ipa_analyze_virtual_call_uses): Likewise. (update_indirect_edges_after_inlining): Update param summaries. (ipa_print_node_params): Print used flags. (ipa_read_indirect_edge_info): Update param summareis. * ipa-prop.h (ipa_param_descriptor): Add used_by_ipa_predicates, used_by_indirect_call and used_by_polymorphic_call. (ipa_set_param_used_by_ipa_predicates, ipa_set_param_used_by_indirect_call, ipa_set_param_used_by_polymorphic_call, ipa_is_param_used_by_ipa_predicates, ipa_is_param_used_by_indirect_call, ipa_is_param_used_by_polymorphic_call): New inline functions. From-SVN: r277759
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h65
1 files changed, 64 insertions, 1 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 121d0f6..9f2479e 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -333,9 +333,12 @@ struct GTY(()) ipa_param_descriptor
says how many there are. If any use could not be described by means of
ipa-prop structures, this is IPA_UNDESCRIBED_USE. */
int controlled_uses;
- unsigned int move_cost : 31;
+ unsigned int move_cost : 28;
/* The parameter is used. */
unsigned used : 1;
+ unsigned used_by_ipa_predicates : 1;
+ unsigned used_by_indirect_call : 1;
+ unsigned used_by_polymorphic_call : 1;
};
/* ipa_node_params stores information related to formal parameters of functions
@@ -519,6 +522,36 @@ ipa_set_param_used (class ipa_node_params *info, int i, bool val)
(*info->descriptors)[i].used = val;
}
+/* Set the used_by_ipa_predicates flag corresponding to the Ith formal
+ parameter of the function associated with INFO to VAL. */
+
+static inline void
+ipa_set_param_used_by_ipa_predicates (class ipa_node_params *info, int i, bool val)
+{
+ gcc_checking_assert (info->descriptors);
+ (*info->descriptors)[i].used_by_ipa_predicates = val;
+}
+
+/* Set the used_by_indirect_call flag corresponding to the Ith formal
+ parameter of the function associated with INFO to VAL. */
+
+static inline void
+ipa_set_param_used_by_indirect_call (class ipa_node_params *info, int i, bool val)
+{
+ gcc_checking_assert (info->descriptors);
+ (*info->descriptors)[i].used_by_indirect_call = val;
+}
+
+/* Set the .used_by_polymorphic_call flag corresponding to the Ith formal
+ parameter of the function associated with INFO to VAL. */
+
+static inline void
+ipa_set_param_used_by_polymorphic_call (class ipa_node_params *info, int i, bool val)
+{
+ gcc_checking_assert (info->descriptors);
+ (*info->descriptors)[i].used_by_polymorphic_call = val;
+}
+
/* Return how many uses described by ipa-prop a parameter has or
IPA_UNDESCRIBED_USE if there is a use that is not described by these
structures. */
@@ -550,6 +583,36 @@ ipa_is_param_used (class ipa_node_params *info, int i)
return (*info->descriptors)[i].used;
}
+/* Return the used_by_ipa_predicates flag corresponding to the Ith formal
+ parameter of the function associated with INFO. */
+
+static inline bool
+ipa_is_param_used_by_ipa_predicates (class ipa_node_params *info, int i)
+{
+ gcc_checking_assert (info->descriptors);
+ return (*info->descriptors)[i].used_by_ipa_predicates;
+}
+
+/* Return the used_by_indirect_call flag corresponding to the Ith formal
+ parameter of the function associated with INFO. */
+
+static inline bool
+ipa_is_param_used_by_indirect_call (class ipa_node_params *info, int i)
+{
+ gcc_checking_assert (info->descriptors);
+ return (*info->descriptors)[i].used_by_indirect_call;
+}
+
+/* Return the used_by_polymorphic_call flag corresponding to the Ith formal
+ parameter of the function associated with INFO. */
+
+static inline bool
+ipa_is_param_used_by_polymorphic_call (class ipa_node_params *info, int i)
+{
+ gcc_checking_assert (info->descriptors);
+ return (*info->descriptors)[i].used_by_polymorphic_call;
+}
+
/* Information about replacements done in aggregates for a given node (each
node has its linked list). */
struct GTY(()) ipa_agg_replacement_value