diff options
author | Martin Jambor <mjambor@suse.cz> | 2011-05-13 22:01:59 +0000 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2011-05-13 22:01:59 +0000 |
commit | 1630b2ea7d373efaa4a1d49e45bc3c1445c27826 (patch) | |
tree | 2a7c206f5ca8bf502c60fb2e517ccdc7c268a4bb /gcc/ipa-cp.c | |
parent | 9ab88341d2dc973a29958e0f6dae38c07669a759 (diff) |
2011-05-13 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (ipa_cst_from_jfunc): New function.
* ipa-prop.h (ipa_cst_from_jfunc): Declare.
* ipa-inline-analysis.c (evaluate_conditions_for_edge): Use it.
(evaluate_conditions_for_ipcp_clone): Removed.
(estimate_ipcp_clone_size_and_time): Accept vector of known constants.
* ipa-cp.c (ipcp_estimate_growth): Build vector of known constants.
* ipa-inline.h (estimate_ipcp_clone_size_and_time): Update.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@173739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 41046d117ca..18bfe90235d 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1068,6 +1068,7 @@ ipcp_estimate_growth (struct cgraph_node *node) int removable_args = 0; bool need_original = !cgraph_will_be_removed_from_program_if_no_direct_calls (node); + VEC (tree, heap) *known_vals = NULL; struct ipa_node_params *info; int i, count; int growth; @@ -1085,6 +1086,7 @@ ipcp_estimate_growth (struct cgraph_node *node) info = IPA_NODE_REF (node); count = ipa_get_param_count (info); + VEC_safe_grow_cleared (tree, heap, known_vals, count); if (node->local.can_change_signature) for (i = 0; i < count; i++) { @@ -1095,14 +1097,18 @@ ipcp_estimate_growth (struct cgraph_node *node) removable_args++; if (lat->type == IPA_CONST_VALUE) - removable_args++; + { + removable_args++; + VEC_replace (tree, known_vals, i, lat->constant); + } } /* We make just very simple estimate of savings for removal of operand from call site. Precise cost is difficult to get, as our size metric counts constants and moves as free. Generally we are looking for cases that small function is called very many times. */ - estimate_ipcp_clone_size_and_time (node, &growth, NULL); + estimate_ipcp_clone_size_and_time (node, known_vals, &growth, NULL); + VEC_free (tree, heap, known_vals); growth = growth - removable_args * redirectable_node_callers; if (growth < 0) |