diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-23 20:28:07 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-23 20:28:07 +0000 |
commit | b9c94ed7ac6512c7551a007128fed6f3caf21ed1 (patch) | |
tree | b2d83395a226ce339483346c7db1d16095008402 /gcc/ipa-prop.c | |
parent | c540c53f3450941cd6da7a219d7a4794e2920e8b (diff) | |
download | gcc-b9c94ed7ac6512c7551a007128fed6f3caf21ed1.tar.gz |
* tree.c (decl_address_ip_invariant_p): New function.
* tree.h (decl_address_ip_invariant_p): Declare.
* gimple.c (strip_invariant_refs): Break out from ...
(is_gimple_invariant_address): ... here
(is_gimple_ip_invariant_address): New function.
(is_gimple_ip_invariant): New function.
* gimple.h (is_gimple_ip_invariant_address, is_gimple_ip_invariant):
Declare.
* ipa-cp.c (ipcp_lat_is_const): Remove handling of IPA_CONST_VALUE_REF.
(ipcp_lat_is_insertable): All constants are insertable.
(ipcp_lattice_from_jfunc, ipcp_print_all_lattices): Remove handling of
IPA_CONST_VALUE_REF.
(ipcp_initialize_node_lattices): Propagate all types of operands.
(build_const_val): Do not handle IPA_CONST_VALUE_REF.
(ipcp_create_replace_map): Reformat.
(ipcp_need_redirect_p): Simplify.
(ipcp_insert_stage): Check that argument is used before clonning.
* ipa-prop.c (ipa_print_node_jump_functions): Do not handle IPA_CONST_REF.
(compute_scalar_jump_functions): Simplify using is_gimple_ip_invariat.
(determine_cst_member_ptr): Keep wrapping ADDR_EXPR of members.
(update_call_notes_after_inlining): Expect ADDR_EXPR in operand.
* ipa-prop.h (jump_func_type): Remove IPA_CONST_REF.
(jump_func_type): Remove IPA_CONST_VALUE_REF.
* tree-inline.c (tree_function_versioning): Add variables referenced by
replacing trees.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139523 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 5a93a4a7311..506a9400e15 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -273,7 +273,7 @@ ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node) fprintf (f, " param %d: ", i); if (type == IPA_UNKNOWN) fprintf (f, "UNKNOWN\n"); - else if (type == IPA_CONST || type == IPA_CONST_REF) + else if (type == IPA_CONST) { tree val = jump_func->value.constant; fprintf (f, "CONST: "); @@ -327,33 +327,11 @@ compute_scalar_jump_functions (struct ipa_node_params *info, { arg = gimple_call_arg (call, num); - if (TREE_CODE (arg) == INTEGER_CST - || TREE_CODE (arg) == REAL_CST - || TREE_CODE (arg) == FIXED_CST) + if (is_gimple_ip_invariant (arg)) { functions[num].type = IPA_CONST; functions[num].value.constant = arg; } - else if (TREE_CODE (arg) == ADDR_EXPR) - { - if (TREE_CODE (TREE_OPERAND (arg, 0)) == FUNCTION_DECL) - { - functions[num].type = IPA_CONST; - functions[num].value.constant = TREE_OPERAND (arg, 0); - } - else if (TREE_CODE (TREE_OPERAND (arg, 0)) == CONST_DECL) - { - tree cst_decl = TREE_OPERAND (arg, 0); - - if (TREE_CODE (DECL_INITIAL (cst_decl)) == INTEGER_CST - || TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST - || TREE_CODE (DECL_INITIAL (cst_decl)) == FIXED_CST) - { - functions[num].type = IPA_CONST_REF; - functions[num].value.constant = cst_decl; - } - } - } else if ((TREE_CODE (arg) == SSA_NAME) && SSA_NAME_IS_DEFAULT_DEF (arg)) { int index = ipa_get_param_decl_index (info, SSA_NAME_VAR (arg)); @@ -496,7 +474,7 @@ determine_cst_member_ptr (gimple call, tree arg, tree method_field, method = TREE_OPERAND (rhs, 0); if (delta) { - fill_member_ptr_cst_jump_function (jfunc, method, delta); + fill_member_ptr_cst_jump_function (jfunc, rhs, delta); return; } } @@ -511,7 +489,7 @@ determine_cst_member_ptr (gimple call, tree arg, tree method_field, delta = rhs; if (method) { - fill_member_ptr_cst_jump_function (jfunc, method, delta); + fill_member_ptr_cst_jump_function (jfunc, rhs, delta); return; } } @@ -952,6 +930,10 @@ update_call_notes_after_inlining (struct cgraph_edge *cs, else decl = jfunc->value.constant; + if (TREE_CODE (decl) != ADDR_EXPR) + continue; + decl = TREE_OPERAND (decl, 0); + if (TREE_CODE (decl) != FUNCTION_DECL) continue; callee = cgraph_node (decl); |