Commit 199f1dc4 by Jan Hubicka Committed by Jan Hubicka

ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of function body...


	* ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of
	function body; do not check stdarg field of struct function.

From-SVN: r159472
parent c4b4455f
2010-05-16 Jan Hubicka <jh@suse.cz> 2010-05-16 Jan Hubicka <jh@suse.cz>
* ipa-cp.c (ipcp_versionable_function_p): Walk cgraph edges instead of
function body; do not check stdarg field of struct function.
2010-05-16 Jan Hubicka <jh@suse.cz>
* cgraph.c (dump_cgraph_node): Dump versionable flag. * cgraph.c (dump_cgraph_node): Dump versionable flag.
* cgraph.h (cgraph_local_info): Add versionable flag. * cgraph.h (cgraph_local_info): Add versionable flag.
* ipa-cp.c (ipcp_analyze_node): Set versionable flag. * ipa-cp.c (ipcp_analyze_node): Set versionable flag.
......
...@@ -416,35 +416,21 @@ ipcp_print_all_lattices (FILE * f) ...@@ -416,35 +416,21 @@ ipcp_print_all_lattices (FILE * f)
static bool static bool
ipcp_versionable_function_p (struct cgraph_node *node) ipcp_versionable_function_p (struct cgraph_node *node)
{ {
tree decl = node->decl; struct cgraph_edge *edge;
basic_block bb;
/* There are a number of generic reasons functions cannot be versioned. */ /* There are a number of generic reasons functions cannot be versioned. */
if (!node->local.versionable) if (!node->local.versionable)
return false; return false;
/* Removing arguments doesn't work if the function takes varargs. */ /* Removing arguments doesn't work if the function takes varargs
if (DECL_STRUCT_FUNCTION (decl)->stdarg) or use __builtin_apply_args. */
return false; for (edge = node->callees; edge; edge = edge->next_callee)
/* Removing arguments doesn't work if we use __builtin_apply_args. */
FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (decl))
{ {
gimple_stmt_iterator gsi; tree t = edge->callee->decl;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
{ && (DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS
const_gimple stmt = gsi_stmt (gsi); || DECL_FUNCTION_CODE (t) == BUILT_IN_VA_START))
tree t; return false;
if (!is_gimple_call (stmt))
continue;
t = gimple_call_fndecl (stmt);
if (t == NULL_TREE)
continue;
if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (t) == BUILT_IN_APPLY_ARGS)
return false;
}
} }
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment