Commit 3b97a5c7 by Martin Jambor Committed by Martin Jambor

ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE.

2014-11-14  Martin Jambor  <mjambor@suse.cz>

	* ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE.
	(ipa_pass_through_data): Removed field type_preserved.
	(ipa_ancestor_jf_data): removed fields type and type_preserved.
	(ipa_jump_func): Removed field known_type.
	(ipa_get_jf_known_type_offset): Removed.
	(ipa_get_jf_known_type_base_type): Likewise.
	(ipa_get_jf_known_type_component_type): Likewise.
	(ipa_get_jf_ancestor_type): Likewise.
	* ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling.
	(ipa_get_jf_pass_through_result): Likewise.
	(ipa_get_jf_ancestor_result): Always build ptr_node_type accesses.
	(values_equal_for_ipcp_p): Removed BINFO handling.
	(ipa_get_indirect_edge_target_1): Updated comment.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling
	of IPA_JF_KNOWN_TYPE jump functions.  Do not print removed fields.
	(ipa_set_jf_known_type): Removed.
	(ipa_set_jf_simple_pass_through): Do not set removed fields.  Update
	all callers.
	(ipa_set_jf_arith_pass_through): Likewise.
	(ipa_set_ancestor_jf): Likewise.
	(ipa_binfo_from_known_type_jfunc): Removed.
	(prop_type_change_info): Removed fields known_current_type and
	multiple_types_encountered.
	(extr_type_from_vtbl_ptr_store): Removed.
	(check_stmt_for_type_change): Do not attempt to identify changed type.
	(detect_type_change_from_memory_writes): Do not set the removed fields,
	always set jfunc to unknown.
	(compute_complex_assign_jump_func): Do not detect dynamic type change.
	(compute_complex_ancestor_jump_func): Likewise.
	(compute_known_type_jump_func): Removed.
	(ipa_compute_jump_functions_for_edge): Do not detect dynamic type
	change.  Do not comute known type jump functions.
	(combine_known_type_and_ancestor_jfs): Removed.
	(update_jump_functions_after_inlining): Removed handling of
	IPA_JF_KNOWN_TYPE jump functions.  Do not set removed fields.
	(ipa_write_jump_function): Do not stream removed fields or known type
	jump functions.
	(ipa_read_jump_function): Likewise.

From-SVN: r217589
parent 4ab74a01
2014-11-14 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (jump_func_type): Removed value IPA_JF_KNOWN_TYPE.
(ipa_pass_through_data): Removed field type_preserved.
(ipa_ancestor_jf_data): removed fields type and type_preserved.
(ipa_jump_func): Removed field known_type.
(ipa_get_jf_known_type_offset): Removed.
(ipa_get_jf_known_type_base_type): Likewise.
(ipa_get_jf_known_type_component_type): Likewise.
(ipa_get_jf_ancestor_type): Likewise.
* ipa-cp.c (print_ipcp_constant_value): Removed BINFO handling.
(ipa_get_jf_pass_through_result): Likewise.
(ipa_get_jf_ancestor_result): Always build ptr_node_type accesses.
(values_equal_for_ipcp_p): Removed BINFO handling.
(ipa_get_indirect_edge_target_1): Updated comment.
* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Removed handling
of IPA_JF_KNOWN_TYPE jump functions. Do not print removed fields.
(ipa_set_jf_known_type): Removed.
(ipa_set_jf_simple_pass_through): Do not set removed fields. Update
all callers.
(ipa_set_jf_arith_pass_through): Likewise.
(ipa_set_ancestor_jf): Likewise.
(ipa_binfo_from_known_type_jfunc): Removed.
(prop_type_change_info): Removed fields known_current_type and
multiple_types_encountered.
(extr_type_from_vtbl_ptr_store): Removed.
(check_stmt_for_type_change): Do not attempt to identify changed type.
(detect_type_change_from_memory_writes): Do not set the removed fields,
always set jfunc to unknown.
(compute_complex_assign_jump_func): Do not detect dynamic type change.
(compute_complex_ancestor_jump_func): Likewise.
(compute_known_type_jump_func): Removed.
(ipa_compute_jump_functions_for_edge): Do not detect dynamic type
change. Do not comute known type jump functions.
(combine_known_type_and_ancestor_jfs): Removed.
(update_jump_functions_after_inlining): Removed handling of
IPA_JF_KNOWN_TYPE jump functions. Do not set removed fields.
(ipa_write_jump_function): Do not stream removed fields or known type
jump functions.
(ipa_read_jump_function): Likewise.
2014-11-14 Vladimir Makarov <vmakarov@redhat.com>
* lra-int.h (lra_create_live_ranges): Add parameter.
......@@ -340,12 +340,7 @@ ipcp_lattice<valtype>::is_single_const ()
static void
print_ipcp_constant_value (FILE * f, tree v)
{
if (TREE_CODE (v) == TREE_BINFO)
{
fprintf (f, "BINFO ");
print_generic_expr (f, BINFO_TYPE (v), 0);
}
else if (TREE_CODE (v) == ADDR_EXPR
if (TREE_CODE (v) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (v, 0)) == CONST_DECL)
{
fprintf (f, "& ");
......@@ -842,21 +837,10 @@ ipa_get_jf_pass_through_result (struct ipa_jump_func *jfunc, tree input)
{
tree restype, res;
if (TREE_CODE (input) == TREE_BINFO)
{
if (ipa_get_jf_pass_through_type_preserved (jfunc))
{
gcc_checking_assert (ipa_get_jf_pass_through_operation (jfunc)
== NOP_EXPR);
return input;
}
return NULL_TREE;
}
gcc_checking_assert (is_gimple_ip_invariant (input));
if (ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
return input;
gcc_checking_assert (is_gimple_ip_invariant (input));
if (TREE_CODE_CLASS (ipa_get_jf_pass_through_operation (jfunc))
== tcc_comparison)
restype = boolean_type_node;
......@@ -883,9 +867,7 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
tree t = TREE_OPERAND (input, 0);
t = build_ref_for_offset (EXPR_LOCATION (t), t,
ipa_get_jf_ancestor_offset (jfunc),
ipa_get_jf_ancestor_type (jfunc)
? ipa_get_jf_ancestor_type (jfunc)
: ptr_type_node, NULL, false);
ptr_type_node, NULL, false);
return build_fold_addr_expr (t);
}
else
......@@ -1051,9 +1033,6 @@ values_equal_for_ipcp_p (tree x, tree y)
if (x == y)
return true;
if (TREE_CODE (x) == TREE_BINFO || TREE_CODE (y) == TREE_BINFO)
return false;
if (TREE_CODE (x) == ADDR_EXPR
&& TREE_CODE (y) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (x, 0)) == CONST_DECL
......@@ -1740,9 +1719,8 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
}
/* If an indirect edge IE can be turned into a direct one based on KNOWN_VALS
(which can contain both constants and binfos), KNOWN_CONTEXTS, KNOWN_AGGS or
AGG_REPS return the destination. The latter three can be NULL. If AGG_REPS
is not NULL, KNOWN_AGGS is ignored. */
KNOWN_CONTEXTS, KNOWN_AGGS or AGG_REPS return the destination. The latter
three can be NULL. If AGG_REPS is not NULL, KNOWN_AGGS is ignored. */
static tree
ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
......
......@@ -51,11 +51,6 @@ along with GCC; see the file COPYING3. If not see
parameter or can apply one simple binary operation to it (such jump
functions are called polynomial).
IPA_JF_KNOWN_TYPE is a special type of an "unknown" function that applies
only to pointer parameters. It means that even though we cannot prove that
the passed value is an interprocedural constant, we still know the exact
type of the containing object which may be valuable for devirtualization.
Jump functions are computed in ipa-prop.c by function
update_call_notes_after_inlining. Some information can be lost and jump
functions degraded accordingly when inlining, see
......@@ -64,7 +59,6 @@ along with GCC; see the file COPYING3. If not see
enum jump_func_type
{
IPA_JF_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
IPA_JF_KNOWN_TYPE, /* represented by field known_type */
IPA_JF_CONST, /* represented by field costant */
IPA_JF_PASS_THROUGH, /* represented by field pass_through */
IPA_JF_ANCESTOR /* represented by field ancestor */
......@@ -113,11 +107,6 @@ struct GTY(()) ipa_pass_through_data
ipa_agg_jump_function). The flag is used only when the operation is
NOP_EXPR. */
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
......@@ -127,18 +116,10 @@ struct GTY(()) ipa_ancestor_jf_data
{
/* Offset of the field representing the ancestor. */
HOST_WIDE_INT offset;
/* Type of the result.
When TYPE_PRESERVED is false, TYPE is NULL, since it is only
relevant for the devirtualization machinery. */
tree type;
/* 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. */
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
......@@ -189,7 +170,6 @@ struct GTY (()) ipa_jump_func
functions and member_cst holds constant c++ member functions. */
union jump_func_value
{
struct ipa_known_type_data GTY ((tag ("IPA_JF_KNOWN_TYPE"))) known_type;
struct ipa_constant_data GTY ((tag ("IPA_JF_CONST"))) constant;
struct ipa_pass_through_data GTY ((tag ("IPA_JF_PASS_THROUGH"))) pass_through;
struct ipa_ancestor_jf_data GTY ((tag ("IPA_JF_ANCESTOR"))) ancestor;
......@@ -197,34 +177,6 @@ struct GTY (()) ipa_jump_func
};
/* Return the offset of the component that is described by a known type jump
function JFUNC. */
static inline HOST_WIDE_INT
ipa_get_jf_known_type_offset (struct ipa_jump_func *jfunc)
{
gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
return jfunc->value.known_type.offset;
}
/* Return the base type of a known type jump function JFUNC. */
static inline tree
ipa_get_jf_known_type_base_type (struct ipa_jump_func *jfunc)
{
gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
return jfunc->value.known_type.base_type;
}
/* Return the component type of a known type jump function JFUNC. */
static inline tree
ipa_get_jf_known_type_component_type (struct ipa_jump_func *jfunc)
{
gcc_checking_assert (jfunc->type == IPA_JF_KNOWN_TYPE);
return jfunc->value.known_type.component_type;
}
/* Return the constant stored in a constant jump functin JFUNC. */
static inline tree
......@@ -297,15 +249,6 @@ ipa_get_jf_ancestor_offset (struct ipa_jump_func *jfunc)
return jfunc->value.ancestor.offset;
}
/* Return the result type of an ancestor jump function JFUNC. */
static inline tree
ipa_get_jf_ancestor_type (struct ipa_jump_func *jfunc)
{
gcc_checking_assert (jfunc->type == IPA_JF_ANCESTOR);
return jfunc->value.ancestor.type;
}
/* Return the number of the caller's formal parameter that an ancestor jump
function JFUNC refers to. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment