aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2016-05-18 18:38:56 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2016-05-18 18:38:56 +0200
commit91bb9f80e58963d65a5cd305b438a2d7009cdb09 (patch)
tree857c7ed3fa77c5bf5bc4f278c87060f145482f7d /gcc/cgraph.h
parentc584aca60cbface2621ebf1ccc943df1b7af52ca (diff)
downloadgcc-91bb9f80e58963d65a5cd305b438a2d7009cdb09.zip
gcc-91bb9f80e58963d65a5cd305b438a2d7009cdb09.tar.gz
gcc-91bb9f80e58963d65a5cd305b438a2d7009cdb09.tar.bz2
Indirect inlining of targets from references of global constants
2016-05-18 Martin Jambor <mjambor@suse.cz> PR ipa/69708 * cgraph.h (cgraph_indirect_call_info): New field guaranteed_unmodified. * ipa-cp.c (ipa_get_indirect_edge_target_1): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. * ipa-inline-analysis.c (evaluate_conditions_for_known_args): Also pass the parameter value to ipa_find_agg_cst_for_param. * ipa-prop.c (ipa_load_from_parm_agg): New parameter guaranteed_unmodified, store AA results there instead of bailing out if present. (ipa_note_param_call): Also initialize guaranteed_unmodified flag. (ipa_analyze_indirect_call_uses): Also set guaranteed_unmodified flag. (find_constructor_constant_at_offset): New function. (ipa_find_agg_cst_from_init): Likewise. (ipa_find_agg_cst_for_param): Also seearch for aggregate values in static initializers of contants, report back through a new paameter from_global_constant if that was the case. (try_make_edge_direct_simple_call): Also pass parameter value to ipa_find_agg_cst_for_param, check guaranteed_unmodified when appropriate. (ipa_write_indirect_edge_info): Stream new flag guaranteed_unmodified. (ipa_read_indirect_edge_info): Likewise. * ipa-prop.h (ipa_find_agg_cst_for_param): Update declaration. (ipa_load_from_parm_agg): Likewise. testsuite/ * gcc.dg/ipa/iinline-cstagg-1.c: New test. * gcc.dg/ipa/ipcp-cstagg-1.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-2.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-3.c: Likewise. * gcc.dg/ipa/ipcp-cstagg-4.c: Likewise. From-SVN: r236416
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 8ad9f45..ecafe63 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1579,9 +1579,14 @@ struct GTY(()) cgraph_indirect_call_info
unsigned agg_contents : 1;
/* Set when this is a call through a member pointer. */
unsigned member_ptr : 1;
- /* When the previous bit is set, this one determines whether the destination
- is loaded from a parameter passed by reference. */
+ /* When the agg_contents bit is set, this one determines whether the
+ destination is loaded from a parameter passed by reference. */
unsigned by_ref : 1;
+ /* When the agg_contents bit is set, this one determines whether we can
+ deduce from the function body that the loaded value from the reference is
+ never modified between the invocation of the function and the load
+ point. */
+ unsigned guaranteed_unmodified : 1;
/* For polymorphic calls this specify whether the virtual table pointer
may have changed in between function entry and the call. */
unsigned vptr_changed : 1;