diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-07 07:15:41 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-07 07:15:41 +0000 |
commit | 5215027d365b04789c45a180119b17153bf9034b (patch) | |
tree | 7db8c0f01fc8a04789a979aba7c5334034fbdd67 /gcc/ipa-cp.c | |
parent | 33b1ed324ef6e3d54e82c08d99af8086e292bf87 (diff) | |
download | gcc-5215027d365b04789c45a180119b17153bf9034b.tar.gz |
2009-08-07 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (enum jump_func_type): New value IPA_JF_ANCESTOR, changed
comments.
(struct ipa_pass_through_data): New type.
(struct ipa_ancestor_jf_data): New type.
(union jump_func_value): Removed field formal_id, added fields
pass_through and ancestor.
(struct ipa_param_call_note): Changed type of formal_id to int from
unsigned.
* ipa-prop.c (ipa_print_node_jump_functions): Print pass through with
operations jump functions and ancestor jump functions.
(compute_complex_pass_through): New function.
(compute_scalar_jump_functions): Call compute_complex_pass_through,
reflect changes in the jump function strucutre.
(update_jump_functions_after_inlining): Ignore complex pass-through
and ancestor jump functions.
* ipa-cp.c (ipcp_lattice_from_jfunc): Added support for ancestor and
polynomial pass-through with operation jump functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150554 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index fe335c4f0fa..df6972417bd 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -290,10 +290,43 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat, else if (jfunc->type == IPA_JF_PASS_THROUGH) { struct ipcp_lattice *caller_lat; + tree cst; - caller_lat = ipcp_get_lattice (info, jfunc->value.formal_id); + caller_lat = ipcp_get_lattice (info, jfunc->value.pass_through.formal_id); lat->type = caller_lat->type; - lat->constant = caller_lat->constant; + if (caller_lat->type != IPA_CONST_VALUE) + return; + cst = caller_lat->constant; + + if (jfunc->value.pass_through.operation != NOP_EXPR) + cst = fold_binary (jfunc->value.pass_through.operation, + TREE_TYPE (cst), cst, + jfunc->value.pass_through.operand); + gcc_assert (cst && is_gimple_ip_invariant (cst)); + lat->constant = cst; + } + else if (jfunc->type == IPA_JF_ANCESTOR) + { + struct ipcp_lattice *caller_lat; + tree t; + bool ok; + + caller_lat = ipcp_get_lattice (info, jfunc->value.ancestor.formal_id); + lat->type = caller_lat->type; + if (caller_lat->type != IPA_CONST_VALUE) + return; + if (TREE_CODE (caller_lat->constant) != ADDR_EXPR) + { + /* This can happen when the constant is a NULL pointer. */ + lat->type = IPA_BOTTOM; + return; + } + t = TREE_OPERAND (caller_lat->constant, 0); + ok = build_ref_for_offset (&t, TREE_TYPE (t), + jfunc->value.ancestor.offset, + jfunc->value.ancestor.type, false); + gcc_assert (ok); + lat->constant = build_fold_addr_expr (t); } else lat->type = IPA_BOTTOM; |