aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-05-14 00:01:59 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2011-05-14 00:01:59 +0200
commit411a20d66cc3d87283a0caebbe1400ac2258aea5 (patch)
tree2a7c206f5ca8bf502c60fb2e517ccdc7c268a4bb /gcc/ipa-cp.c
parentd61d771f3bc92b15a77aedb29e36ffe13d3ca47a (diff)
downloadgcc-411a20d66cc3d87283a0caebbe1400ac2258aea5.zip
gcc-411a20d66cc3d87283a0caebbe1400ac2258aea5.tar.gz
gcc-411a20d66cc3d87283a0caebbe1400ac2258aea5.tar.bz2
ipa-prop.c (ipa_cst_from_jfunc): New function.
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. From-SVN: r173739
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 41046d1..18bfe90 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)