summaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-17 22:13:07 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-17 22:13:07 +0000
commitbc1b408aa8c9a23e631a165e1e8a0c0b97a68777 (patch)
tree75a9b1ae8bf1604ec705f1892a04d451a36c520f /gcc/ipa-cp.c
parentfa1a750285740ce8a2a7f9e1278ed71e68105331 (diff)
downloadgcc-bc1b408aa8c9a23e631a165e1e8a0c0b97a68777.tar.gz
* ipa-cp.c (ipcp_update_callgraph): Use ipa_is_param_used.
(ipcp_estimate_growth): Likewise. (ipcp_const_param_count): Likewise. (ipcp_insert_stage): Likewise. * ipa-prop.c (visit_load_for_mod_analysis): New function. (visit_store_addr_for_mod_analysis): Set used flag. (ipa_detect_param_modifications): Set used flag for SSE params; update use of walk_stmt_load_store_addr_ops. (ipa_print_node_params): Print used flag. (ipa_write_node_info): Stream used flag. (ipa_read_node_info): Likewise. * ipa-prop.h (struct ipa_param_descriptor): Add used field. (ipa_is_param_used): New function. (lto_ipa_fixup_call_notes): Remove unused declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159513 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 723de162b1f..f4aab5d2d89 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -917,12 +917,9 @@ ipcp_update_callgraph (void)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
- tree parm_tree = ipa_get_param (info, i);
/* We can proactively remove obviously unused arguments. */
- if (is_gimple_reg (parm_tree)
- && !gimple_default_def (DECL_STRUCT_FUNCTION (orig_node->decl),
- parm_tree))
+ if (!ipa_is_param_used (info, i))
{
bitmap_set_bit (args_to_skip, i);
continue;
@@ -995,12 +992,9 @@ ipcp_estimate_growth (struct cgraph_node *node)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
- tree parm_tree = ipa_get_param (info, i);
/* We can proactively remove obviously unused arguments. */
- if (is_gimple_reg (parm_tree)
- && !gimple_default_def (DECL_STRUCT_FUNCTION (node->decl),
- parm_tree))
+ if (!ipa_is_param_used (info, i))
removable_args++;
if (lat->type == IPA_CONST_VALUE)
@@ -1068,12 +1062,9 @@ ipcp_const_param_count (struct cgraph_node *node)
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
- tree parm_tree = ipa_get_param (info, i);
if (ipcp_lat_is_insertable (lat)
/* Do not count obviously unused arguments. */
- && (!is_gimple_reg (parm_tree)
- || gimple_default_def (DECL_STRUCT_FUNCTION (node->decl),
- parm_tree)))
+ && ipa_is_param_used (info, i))
const_param++;
}
return const_param;
@@ -1177,9 +1168,7 @@ ipcp_insert_stage (void)
parm_tree = ipa_get_param (info, i);
/* We can proactively remove obviously unused arguments. */
- if (is_gimple_reg (parm_tree)
- && !gimple_default_def (DECL_STRUCT_FUNCTION (node->decl),
- parm_tree))
+ if (!ipa_is_param_used (info, i))
{
bitmap_set_bit (args_to_skip, i);
continue;