aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.h
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2013-08-27 23:41:15 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2013-08-27 23:41:15 +0200
commitb8f6e610c06d35b386899f72e8b767f952ce4589 (patch)
treea2d5071d970254c4acebb2d4c7039bfa0e43d18a /gcc/ipa-prop.h
parent74bf76ed78a14069969e94233f05e7840806aed8 (diff)
downloadgcc-b8f6e610c06d35b386899f72e8b767f952ce4589.zip
gcc-b8f6e610c06d35b386899f72e8b767f952ce4589.tar.gz
gcc-b8f6e610c06d35b386899f72e8b767f952ce4589.tar.bz2
ipa-prop.h (ipa_pass_through_data): New field type_preserved.
2013-08-27 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (ipa_pass_through_data): New field type_preserved. (ipa_ancestor_jf_data): Likewise. (ipa_get_jf_pass_through_agg_preserved): Fix comment typo. (ipa_get_jf_pass_through_type_preserved): New function. (ipa_get_jf_ancestor_agg_preserved): Fix comment typo. (ipa_get_jf_ancestor_type_preserved): New function. * ipa-cp.c (ipa_get_jf_pass_through_result): Honor type_preserved flag. (ipa_get_jf_ancestor_result): Likewise. (propagate_vals_accross_pass_through): Use ipa_get_jf_pass_through_result to do all the value mappings. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Dump the type_preserved flag. (ipa_set_jf_cst_copy): New function. (ipa_set_jf_simple_pass_through): Set the type_preserved flag. (ipa_set_jf_arith_pass_through): Likewise. (ipa_set_ancestor_jf): Likewise. (compute_complex_assign_jump_func): Set type_preserved instead of punting. (ipa_compute_jump_functions_for_edge): Likewise. (combine_known_type_and_ancestor_jfs): Honor type_preserved. (update_jump_functions_after_inlining): Update type_preserved. Explicitely create jump functions when combining one with pass_through. (ipa_write_jump_function): Stream the type_preserved flags. (ipa_read_jump_function): Likewise. From-SVN: r202036
Diffstat (limited to 'gcc/ipa-prop.h')
-rw-r--r--gcc/ipa-prop.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 2ccac2f..48634d2 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -117,7 +117,12 @@ struct GTY(()) ipa_pass_through_data
aggregate part of the jump function (see description of
ipa_agg_jump_function). The flag is used only when the operation is
NOP_EXPR. */
- bool agg_preserved;
+ unsigned agg_preserved : 1;
+
+ /* When set to true, we guarantee that, if there is a C++ object pointed to
+ by this object, it does not undergo dynamic type change in the course of
+ functions decribed by this jump function. */
+ unsigned type_preserved : 1;
};
/* Structure holding data required to describe an ancestor pass-through
@@ -132,7 +137,11 @@ struct GTY(()) ipa_ancestor_jf_data
/* Number of the caller's formal parameter being passed. */
int formal_id;
/* Flag with the same meaning like agg_preserve in ipa_pass_through_data. */
- bool agg_preserved;
+ unsigned agg_preserved : 1;
+ /* When set to true, we guarantee that, if there is a C++ object pointed to
+ by this object, it does not undergo dynamic type change in the course of
+ functions decribed by this jump function. */
+ unsigned type_preserved : 1;
};
/* An element in an aggegate part of a jump function describing a known value
@@ -264,7 +273,7 @@ ipa_get_jf_pass_through_operation (struct ipa_jump_func *jfunc)
return jfunc->value.pass_through.operation;
}
-/* Return the agg_preserved flag of a pass through jump functin JFUNC. */
+/* Return the agg_preserved flag of a pass through jump function JFUNC. */
static inline bool
ipa_get_jf_pass_through_agg_preserved (struct ipa_jump_func *jfunc)
@@ -273,6 +282,15 @@ ipa_get_jf_pass_through_agg_preserved (struct ipa_jump_func *jfunc)
return jfunc->value.pass_through.agg_preserved;
}
+/* Return the type_preserved flag of a pass through jump function JFUNC. */
+
+static inline bool
+ipa_get_jf_pass_through_type_preserved (struct ipa_jump_func *jfunc)
+{
+ gcc_checking_assert (jfunc->type == IPA_JF_PASS_THROUGH);
+ return jfunc->value.pass_through.type_preserved;
+}
+
/* Return the offset of an ancestor jump function JFUNC. */
static inline HOST_WIDE_INT
@@ -301,7 +319,7 @@ ipa_get_jf_ancestor_formal_id (struct ipa_jump_func *jfunc)
return jfunc->value.ancestor.formal_id;
}
-/* Return the agg_preserved flag of an ancestor jump functin JFUNC. */
+/* Return the agg_preserved flag of an ancestor jump function JFUNC. */
static inline bool
ipa_get_jf_ancestor_agg_preserved (struct ipa_jump_func *jfunc)
@@ -310,6 +328,15 @@ ipa_get_jf_ancestor_agg_preserved (struct ipa_jump_func *jfunc)
return jfunc->value.ancestor.agg_preserved;
}
+/* Return the type_preserved flag of an ancestor jump function JFUNC. */
+
+static inline bool
+ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc)
+{
+ gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
+ return jfunc->value.ancestor.type_preserved;
+}
+
/* Summary describing a single formal parameter. */
struct ipa_param_descriptor